| 123456789101112131415161718192021222324252627 |
- """只填皮重时,不应因为补了毛重时间而把出入库单算作已完成。"""
- 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
- )
|