test: Adjust test as per teardown

- make tests use multi level bom in WO, as BOM at setup is used
- earlier, an intermediate BOM made in a test would override the BOM at setup
This commit is contained in:
marination 2022-03-01 12:24:45 +05:30
parent 789e042f7d
commit 25fa6344a6
2 changed files with 4 additions and 2 deletions

View File

@ -154,7 +154,7 @@ class TestProductionPlan(FrappeTestCase):
use_multi_level_bom=0, use_multi_level_bom=0,
ignore_existing_ordered_qty=0 ignore_existing_ordered_qty=0
) )
self.assertTrue(len(pln.mr_items), 0) self.assertTrue(len(pln.mr_items))
sr1.cancel() sr1.cancel()
sr2.cancel() sr2.cancel()
@ -575,6 +575,7 @@ class TestProductionPlan(FrappeTestCase):
wip_warehouse='Work In Progress - _TC', wip_warehouse='Work In Progress - _TC',
fg_warehouse='Finished Goods - _TC', fg_warehouse='Finished Goods - _TC',
skip_transfer=1, skip_transfer=1,
use_multi_level_bom=1,
do_not_submit=True do_not_submit=True
) )
wo.production_plan = pln.name wo.production_plan = pln.name
@ -619,6 +620,7 @@ class TestProductionPlan(FrappeTestCase):
wip_warehouse='Work In Progress - _TC', wip_warehouse='Work In Progress - _TC',
fg_warehouse='Finished Goods - _TC', fg_warehouse='Finished Goods - _TC',
skip_transfer=1, skip_transfer=1,
use_multi_level_bom=1,
do_not_submit=True do_not_submit=True
) )
wo.production_plan = pln.name wo.production_plan = pln.name

View File

@ -1040,7 +1040,7 @@ def make_wo_order_test_record(**args):
wo_order.scrap_warehouse = args.fg_warehouse or "_Test Scrap Warehouse - _TC" wo_order.scrap_warehouse = args.fg_warehouse or "_Test Scrap Warehouse - _TC"
wo_order.company = args.company or "_Test Company" wo_order.company = args.company or "_Test Company"
wo_order.stock_uom = args.stock_uom or "_Test UOM" wo_order.stock_uom = args.stock_uom or "_Test UOM"
wo_order.use_multi_level_bom=0 wo_order.use_multi_level_bom= args.use_multi_level_bom or 0
wo_order.skip_transfer=args.skip_transfer or 0 wo_order.skip_transfer=args.skip_transfer or 0
wo_order.get_items_and_operations_from_bom() wo_order.get_items_and_operations_from_bom()
wo_order.sales_order = args.sales_order or None wo_order.sales_order = args.sales_order or None