fix: Server side test
- make `tests_that_skip_setup` a tuple (added comma) - remove manual teardown in `test_job_card_material_transfer_correctness` to avoid premature committing - transfer_material_against = "Job Card" while making BOM with mulitple operations
This commit is contained in:
parent
18f9e3558e
commit
bb561ba7a8
@ -20,7 +20,7 @@ class TestJobCard(unittest.TestCase):
|
|||||||
transfer_material_against, source_warehouse = None, None
|
transfer_material_against, source_warehouse = None, None
|
||||||
|
|
||||||
tests_that_skip_setup = (
|
tests_that_skip_setup = (
|
||||||
"test_job_card_material_transfer_correctness"
|
"test_job_card_material_transfer_correctness",
|
||||||
)
|
)
|
||||||
tests_that_transfer_against_jc = (
|
tests_that_transfer_against_jc = (
|
||||||
"test_job_card_multiple_materials_transfer",
|
"test_job_card_multiple_materials_transfer",
|
||||||
@ -272,14 +272,10 @@ class TestJobCard(unittest.TestCase):
|
|||||||
self.assertEqual(transfer_entry.items[0].item_code, "_Test Item")
|
self.assertEqual(transfer_entry.items[0].item_code, "_Test Item")
|
||||||
self.assertEqual(transfer_entry.items[0].qty, 2)
|
self.assertEqual(transfer_entry.items[0].qty, 2)
|
||||||
|
|
||||||
# teardown
|
# rollback via tearDown method
|
||||||
transfer_entry.delete()
|
|
||||||
frappe.db.delete("Job Card", {"work_order": work_order.name})
|
|
||||||
work_order.cancel()
|
|
||||||
bom.cancel()
|
|
||||||
|
|
||||||
|
|
||||||
def create_bom_with_multiple_operations():
|
def create_bom_with_multiple_operations():
|
||||||
|
"Create a BOM with multiple operations and Material Transfer against Job Card"
|
||||||
from erpnext.manufacturing.doctype.operation.test_operation import make_operation
|
from erpnext.manufacturing.doctype.operation.test_operation import make_operation
|
||||||
|
|
||||||
test_record = frappe.get_test_records("BOM")[2]
|
test_record = frappe.get_test_records("BOM")[2]
|
||||||
@ -303,6 +299,7 @@ def create_bom_with_multiple_operations():
|
|||||||
"operating_cost": 100
|
"operating_cost": 100
|
||||||
})
|
})
|
||||||
|
|
||||||
|
bom_doc.transfer_material_against = "Job Card"
|
||||||
bom_doc.save()
|
bom_doc.save()
|
||||||
bom_doc.submit()
|
bom_doc.submit()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user