refactor(test): set mandatory dimension at invidual test cases

This commit is contained in:
ruthra kumar
2025-05-08 13:17:21 +05:30
parent 74f8d65021
commit fb92183679
2 changed files with 8 additions and 0 deletions

View File

@@ -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",

View File

@@ -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)