mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 23:52:57 +00:00
refactor(test): set mandatory dimension at invidual test cases
This commit is contained in:
@@ -58,6 +58,10 @@ class TestAccountingDimension(IntegrationTestCase):
|
|||||||
self.assertEqual(gle1.get("department"), "_Test Department - _TC")
|
self.assertEqual(gle1.get("department"), "_Test Department - _TC")
|
||||||
|
|
||||||
def test_mandatory(self):
|
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 = create_sales_invoice(do_not_save=1)
|
||||||
si.append(
|
si.append(
|
||||||
"items",
|
"items",
|
||||||
|
|||||||
@@ -159,6 +159,10 @@ class TestPOSClosingEntry(IntegrationTestCase):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
create_dimension()
|
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)
|
pos_profile = make_pos_profile(do_not_insert=1, do_not_set_accounting_dimension=1)
|
||||||
|
|
||||||
self.assertRaises(frappe.ValidationError, pos_profile.insert)
|
self.assertRaises(frappe.ValidationError, pos_profile.insert)
|
||||||
|
|||||||
Reference in New Issue
Block a user