From 4bb66179ab7581930a568f4eec6a25195b9ab6fe Mon Sep 17 00:00:00 2001 From: rehansari26 Date: Thu, 16 Oct 2025 11:04:48 +0530 Subject: [PATCH] test: replace get_doc with new_doc in fiscal year tests (cherry picked from commit d59e55fb08296f1258ee1ed80b514d251a53b815) --- .../doctype/fiscal_year/test_fiscal_year.py | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py b/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py index 6bdcf7b2067..9fb78bf41bf 100644 --- a/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py +++ b/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py @@ -31,25 +31,17 @@ class TestFiscalYear(unittest.TestCase): if frappe.db.exists("Fiscal Year", name): frappe.delete_doc("Fiscal Year", name) - global_fy = frappe.get_doc( - { - "doctype": "Fiscal Year", - "year": "_Test Global FY 2001", - "year_start_date": "2001-04-01", - "year_end_date": "2002-03-31", - } - ) + global_fy = frappe.new_doc("Fiscal Year") + global_fy.year = "_Test Global FY 2001" + global_fy.year_start_date = "2001-04-01" + global_fy.year_end_date = "2002-03-31" global_fy.insert() - company_fy = frappe.get_doc( - { - "doctype": "Fiscal Year", - "year": "_Test Company FY 2001", - "year_start_date": "2001-01-01", - "year_end_date": "2001-12-31", - "companies": [{"company": "_Test Company"}], - } - ) + company_fy = frappe.new_doc("Fiscal Year") + company_fy.year = "_Test Company FY 2001" + company_fy.year_start_date = "2001-01-01" + company_fy.year_end_date = "2001-12-31" + company_fy.append("companies", {"company": "_Test Company"}) company_fy.insert() self.assertTrue(frappe.db.exists("Fiscal Year", global_fy.name))