From 9ed072ac834e6986adae28100367ab9e0dbdc55b Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Fri, 20 Mar 2026 12:02:02 +0530 Subject: [PATCH] refactor(test): move company setup to bootstrap --- .../test_opening_invoice_creation_tool.py | 18 ------------------ .../setup/doctype/company/test_records.json | 8 ++++++++ 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/erpnext/accounts/doctype/opening_invoice_creation_tool/test_opening_invoice_creation_tool.py b/erpnext/accounts/doctype/opening_invoice_creation_tool/test_opening_invoice_creation_tool.py index 1a61adad4cd..c01ada6d317 100644 --- a/erpnext/accounts/doctype/opening_invoice_creation_tool/test_opening_invoice_creation_tool.py +++ b/erpnext/accounts/doctype/opening_invoice_creation_tool/test_opening_invoice_creation_tool.py @@ -10,11 +10,6 @@ from erpnext.tests.utils import ERPNextTestSuite class TestOpeningInvoiceCreationTool(ERPNextTestSuite): - def setUp(self): - # TODO: move to bootstrap - if not frappe.db.exists("Company", "_Test Opening Invoice Company"): - make_company() - def make_invoices( self, invoice_type="Sales", @@ -179,19 +174,6 @@ def get_opening_invoice_creation_dict(**args): return invoice_dict -def make_company(): - if frappe.db.exists("Company", "_Test Opening Invoice Company"): - return frappe.get_doc("Company", "_Test Opening Invoice Company") - - company = frappe.new_doc("Company") - company.company_name = "_Test Opening Invoice Company" - company.abbr = "_TOIC" - company.default_currency = "INR" - company.country = "Pakistan" - company.insert() - return company - - def make_customer(customer=None): customer_name = customer or "Opening Customer" customer = frappe.get_doc( diff --git a/erpnext/setup/doctype/company/test_records.json b/erpnext/setup/doctype/company/test_records.json index 1b51d98413e..f26caa50fde 100644 --- a/erpnext/setup/doctype/company/test_records.json +++ b/erpnext/setup/doctype/company/test_records.json @@ -180,5 +180,13 @@ "default_currency": "ZAR", "doctype": "Company", "create_chart_of_accounts_based_on": "Standard Template" + }, + { + "abbr": "_TOIC", + "company_name": "_Test Opening Invoice Company", + "country": "Pakistan", + "default_currency": "INR", + "doctype": "Company", + "create_chart_of_accounts_based_on": "Standard Template" } ]