diff --git a/core/model/account_test.go b/core/model/account_test.go index 32fb972..0b3872b 100644 --- a/core/model/account_test.go +++ b/core/model/account_test.go @@ -162,6 +162,10 @@ func TestCreateAccount(t *testing.T) { td := &TdAccount{} td.On("GetAccountsByOrgId", "1").Return(getTestAccounts(), nil) + // Mock GetSplitCountByAccountId for parent account check + if test.account.Parent != "" { + td.On("GetSplitCountByAccountId", test.account.Parent).Return(int64(0), nil) + } model := NewModel(td, nil, types.Config{}) @@ -206,6 +210,10 @@ func TestUpdateAccount(t *testing.T) { td := &TdAccount{} td.On("GetAccountsByOrgId", "1").Return(getTestAccounts(), nil) + // Mock GetSplitCountByAccountId for parent account check + if test.account.Parent != "" { + td.On("GetSplitCountByAccountId", test.account.Parent).Return(int64(0), nil) + } model := NewModel(td, nil, types.Config{})