From 22c1608745719fa79241ee7faa925d0b112d17b2 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Tue, 10 Dec 2024 13:04:44 +0530 Subject: [PATCH] test: assert all reqd are set --- erpnext/controllers/tests/test_reactivity.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/erpnext/controllers/tests/test_reactivity.py b/erpnext/controllers/tests/test_reactivity.py index 854d6cf0e11..5e8ec4259a2 100644 --- a/erpnext/controllers/tests/test_reactivity.py +++ b/erpnext/controllers/tests/test_reactivity.py @@ -6,7 +6,7 @@ from frappe.utils import getdate, today from erpnext.accounts.test.accounts_mixin import AccountsTestMixin -class TestAccountsController(AccountsTestMixin, IntegrationTestCase): +class TestReactivity(AccountsTestMixin, IntegrationTestCase): def setUp(self): self.create_company() self.create_customer() @@ -48,3 +48,12 @@ class TestAccountsController(AccountsTestMixin, IntegrationTestCase): itm.item_code = self.item si.process_item_selection(si.items[0].name) self.assertEqual(itm.rate, 90) + + df = qb.DocType("DocField") + _res = ( + qb.from_(df).select(df.fieldname).where(df.parent.eq("Sales Invoice Item") & df.reqd.eq(1)).run() + ) + for field in _res: + with self.subTest(field=field): + self.assertIsNotNone(itm.get(field[0])) + si.save().submit()