Files
shanxia2.0/backend/tests/test_db_weighing_complete.py
T
wuzilongandCursor bde19c0644 feat: 锁定执行中计划并按装卸明细差量归档库存,补齐派车日历数量与酸碱类型。
执行中的运输计划不再随意改单;库存流水记到装卸产品明细;手工派车日历区分酸碱并记录数量。同时收紧合同附件与子表的差量保存,并清理已废弃的 bak 备份目录。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-29 07:59:53 +08:00

28 lines
773 B
Python

"""只填皮重时,不应因为补了毛重时间而把出入库单算作已完成。"""
from datetime import datetime
from app.services.db.weighing_logic import weighing_weights_complete
def test_tare_only_is_not_complete():
assert (
weighing_weights_complete(0, datetime(2026, 10, 28, 17, 0), 12000, datetime(2026, 10, 28, 17, 1))
is False
)
def test_missing_gross_time_is_not_complete():
assert weighing_weights_complete(32000, None, 12000, datetime(2026, 10, 28, 17, 1)) is False
def test_both_weights_and_times_are_complete():
assert (
weighing_weights_complete(
32000,
datetime(2026, 10, 28, 17, 0),
12000,
datetime(2026, 10, 28, 17, 1),
)
is True
)