test: replace get_doc with new_doc in fiscal year tests

This commit is contained in:
rehansari26
2025-10-16 11:04:48 +05:30
parent 94ae098854
commit d59e55fb08

View File

@@ -30,25 +30,17 @@ class TestFiscalYear(IntegrationTestCase):
if frappe.db.exists("Fiscal Year", name): if frappe.db.exists("Fiscal Year", name):
frappe.delete_doc("Fiscal Year", name) frappe.delete_doc("Fiscal Year", name)
global_fy = frappe.get_doc( global_fy = frappe.new_doc("Fiscal Year")
{ global_fy.year = "_Test Global FY 2001"
"doctype": "Fiscal Year", global_fy.year_start_date = "2001-04-01"
"year": "_Test Global FY 2001", global_fy.year_end_date = "2002-03-31"
"year_start_date": "2001-04-01",
"year_end_date": "2002-03-31",
}
)
global_fy.insert() global_fy.insert()
company_fy = frappe.get_doc( company_fy = frappe.new_doc("Fiscal Year")
{ company_fy.year = "_Test Company FY 2001"
"doctype": "Fiscal Year", company_fy.year_start_date = "2001-01-01"
"year": "_Test Company FY 2001", company_fy.year_end_date = "2001-12-31"
"year_start_date": "2001-01-01", company_fy.append("companies", {"company": "_Test Company"})
"year_end_date": "2001-12-31",
"companies": [{"company": "_Test Company"}],
}
)
company_fy.insert() company_fy.insert()
self.assertTrue(frappe.db.exists("Fiscal Year", global_fy.name)) self.assertTrue(frappe.db.exists("Fiscal Year", global_fy.name))