test: add unit test to validate account type and party type

(cherry picked from commit 9422ce5aee)
This commit is contained in:
rethik
2025-02-03 19:29:59 +05:30
committed by Mergify
parent bb3eb81170
commit 552b5a79ce

View File

@@ -124,3 +124,20 @@ class TestGLEntry(unittest.TestCase):
str(e),
"Party Type and Party can only be set for Receivable / Payable account_Test Account Cost for Goods Sold - _TC",
)
def test_validate_account_party_type_shareholder(self):
jv = make_journal_entry(
"Opening Balance Equity - _TC",
"Cash - _TC",
100,
"_Test Cost Center - _TC",
save=False,
submit=False,
)
for row in jv.accounts:
row.party_type = "Shareholder"
break
jv.save().submit()
self.assertEqual(1, jv.docstatus)