From d2cc5f2482727ee82ef914ea768311a5c1f94996 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Wed, 9 Feb 2022 11:19:01 +0530 Subject: [PATCH] test: remove dependency on other tests --- .../doctype/work_order/test_work_order.py | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/erpnext/manufacturing/doctype/work_order/test_work_order.py b/erpnext/manufacturing/doctype/work_order/test_work_order.py index a38e04a5c7..1145a586a5 100644 --- a/erpnext/manufacturing/doctype/work_order/test_work_order.py +++ b/erpnext/manufacturing/doctype/work_order/test_work_order.py @@ -201,18 +201,20 @@ class TestWorkOrder(ERPNextTestCase): self.assertEqual(cint(bin1_on_end_production.reserved_qty_for_production), cint(bin1_on_start_production.reserved_qty_for_production)) - def test_reserved_qty_for_production(self): - self.bin1_at_start = get_bin(self.item, self.warehouse) - self.bin1_at_start.update_reserved_qty_for_production() - self.test_reserved_qty_for_production_submit() - self.test_reserved_qty_for_production_cancel() - self.test_close_work_order() - self.wo_order = make_wo_order_test_record(item="_Test FG Item", qty=2, + def test_reserved_qty_for_production_closed(self): + + wo1 = make_wo_order_test_record(item="_Test FG Item", qty=2, source_warehouse=self.warehouse) - self.bin1_on_submit = get_bin(self.item, self.warehouse) - bin1_on_end_production = get_bin(self.item, self.warehouse) - self.assertEqual(cint(bin1_on_end_production.reserved_qty_for_production), - cint(self.bin1_at_start.reserved_qty_for_production) + 2) + item = wo1.required_items[0].item_code + bin_before = get_bin(item, self.warehouse) + bin_before.update_reserved_qty_for_production() + + make_wo_order_test_record(item="_Test FG Item", qty=2, + source_warehouse=self.warehouse) + close_work_order(wo1.name, "Closed") + + bin_after = get_bin(item, self.warehouse) + self.assertEqual(bin_before.reserved_qty_for_production, bin_after.reserved_qty_for_production) def test_backflush_qty_for_overpduction_manufacture(self): cancel_stock_entry = []