diff --git a/erpnext/controllers/tests/test_item_wise_inventory_account.py b/erpnext/controllers/tests/test_item_wise_inventory_account.py index 398a8388865..7cb6930b424 100644 --- a/erpnext/controllers/tests/test_item_wise_inventory_account.py +++ b/erpnext/controllers/tests/test_item_wise_inventory_account.py @@ -18,12 +18,13 @@ from erpnext.tests.utils import ERPNextTestSuite class TestItemWiseInventoryAccount(ERPNextTestSuite): def setUp(self): - self.company = make_company() - self.company_abbr = frappe.db.get_value("Company", self.company, "abbr") + self.company = "_Test Company with perpetual inventory" + self.company_abbr = "TCP1" self.default_warehouse = frappe.db.get_value( "Warehouse", {"company": self.company, "is_group": 0, "warehouse_name": ("like", "%Stores%")}, ) + frappe.db.set_value("Company", self.company, "enable_item_wise_inventory_account", 1) def test_item_account_for_purchase_receipt_entry(self): items = { @@ -579,23 +580,3 @@ class TestItemWiseInventoryAccount(ERPNextTestSuite): gl_value = gl_value * -1 self.assertEqual(sle_value, gl_value, f"GL Entry not created for {item_code} correctly") - - -def make_company(): - company = "_Test Company for Item Wise Inventory Account" - if frappe.db.exists("Company", company): - return company - - company = frappe.get_doc( - { - "doctype": "Company", - "company_name": "_Test Company for Item Wise Inventory Account", - "abbr": "_TCIWIA", - "default_currency": "INR", - "country": "India", - "enable_perpetual_inventory": 1, - "enable_item_wise_inventory_account": 1, - } - ).insert() - - return company.name