From 9422ce5aee303c738de4fda9dc01cc02fd1bbfc9 Mon Sep 17 00:00:00 2001 From: rethik Date: Mon, 3 Feb 2025 19:29:59 +0530 Subject: [PATCH] test: add unit test to validate account type and party type --- .../accounts/doctype/gl_entry/test_gl_entry.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/erpnext/accounts/doctype/gl_entry/test_gl_entry.py b/erpnext/accounts/doctype/gl_entry/test_gl_entry.py index 209454e7b21..11269f005db 100644 --- a/erpnext/accounts/doctype/gl_entry/test_gl_entry.py +++ b/erpnext/accounts/doctype/gl_entry/test_gl_entry.py @@ -123,3 +123,20 @@ class TestGLEntry(IntegrationTestCase): 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)