forked from erp-dev/erp
fix: stock-snapshots api and service calc wrong result
This commit is contained in:
@@ -241,6 +241,7 @@ class CreateStockSnapshotTestCase(StockServicesTestCase):
|
||||
self.assertEqual(snapshot.delta, 100) # 入库数量为正
|
||||
self.assertEqual(snapshot.quantity_before, 50) # 150 - 100
|
||||
self.assertEqual(snapshot.quantity_after, 150)
|
||||
self.assertEqual(snapshot.num_of_rolls, self.inventory.num_of_rolls)
|
||||
self.assertEqual(snapshot.stock_change_record_id, self.stock_change_in.id)
|
||||
|
||||
# 验证日志调用
|
||||
@@ -257,6 +258,7 @@ class CreateStockSnapshotTestCase(StockServicesTestCase):
|
||||
self.assertEqual(snapshot.delta, -50) # 出库数量为负
|
||||
self.assertEqual(snapshot.quantity_before, 200) # 150 - (-50)
|
||||
self.assertEqual(snapshot.quantity_after, 150)
|
||||
self.assertEqual(snapshot.num_of_rolls, self.inventory.num_of_rolls)
|
||||
|
||||
def test_create_snapshot_with_invalid_detail(self):
|
||||
"""测试使用无效明细记录创建快照"""
|
||||
|
||||
Reference in New Issue
Block a user