From fb921836794fa1f1c4ac4993d5f286006b47b3a8 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 8 May 2025 13:17:21 +0530 Subject: [PATCH] refactor(test): set mandatory dimension at invidual test cases --- .../doctype/accounting_dimension/test_accounting_dimension.py | 4 ++++ .../doctype/pos_closing_entry/test_pos_closing_entry.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/erpnext/accounts/doctype/accounting_dimension/test_accounting_dimension.py b/erpnext/accounts/doctype/accounting_dimension/test_accounting_dimension.py index c3d1e295c8b..769522e2642 100644 --- a/erpnext/accounts/doctype/accounting_dimension/test_accounting_dimension.py +++ b/erpnext/accounts/doctype/accounting_dimension/test_accounting_dimension.py @@ -58,6 +58,10 @@ class TestAccountingDimension(IntegrationTestCase): self.assertEqual(gle1.get("department"), "_Test Department - _TC") def test_mandatory(self): + location = frappe.get_doc("Accounting Dimension", "Location") + location.dimension_defaults[0].mandatory_for_bs = True + location.save() + si = create_sales_invoice(do_not_save=1) si.append( "items", diff --git a/erpnext/accounts/doctype/pos_closing_entry/test_pos_closing_entry.py b/erpnext/accounts/doctype/pos_closing_entry/test_pos_closing_entry.py index d2bd406f03b..fd620053728 100644 --- a/erpnext/accounts/doctype/pos_closing_entry/test_pos_closing_entry.py +++ b/erpnext/accounts/doctype/pos_closing_entry/test_pos_closing_entry.py @@ -159,6 +159,10 @@ class TestPOSClosingEntry(IntegrationTestCase): """ create_dimension() + location = frappe.get_doc("Accounting Dimension", "Location") + location.dimension_defaults[0].mandatory_for_bs = True + location.save() + pos_profile = make_pos_profile(do_not_insert=1, do_not_set_accounting_dimension=1) self.assertRaises(frappe.ValidationError, pos_profile.insert)