feat: 完善真实采购订单核对与恢复 (#100)
This commit is contained in:
@@ -113,10 +113,21 @@ class TaskRepositoryTests(unittest.TestCase):
|
||||
"PURCHASE-LIVE", "192.168.0.173:5555"
|
||||
)
|
||||
marked_at = self.repository.mark_purchase_irreversible(
|
||||
"PURCHASE-LIVE", started.attempt_id
|
||||
"PURCHASE-LIVE",
|
||||
started.attempt_id,
|
||||
{
|
||||
"options": {"color": "黑色", "size": "L"},
|
||||
"quantity": 2,
|
||||
"unit_price_cent": 3990,
|
||||
"total_price_cent": 7980,
|
||||
},
|
||||
)
|
||||
run = self.repository.latest_task_run("PURCHASE-LIVE")
|
||||
self.assertEqual(run.irreversible_action_at, marked_at)
|
||||
self.assertEqual(
|
||||
run.diagnostics_json["final_confirmation"]["total_price_cent"],
|
||||
7980,
|
||||
)
|
||||
with self.assertRaisesRegex(ValueError, "已经存在"):
|
||||
self.repository.mark_purchase_irreversible(
|
||||
"PURCHASE-LIVE", started.attempt_id
|
||||
|
||||
Reference in New Issue
Block a user