Added exception for AccountNotFound

This commit is contained in:
2022-05-27 22:19:17 +12:00
parent 7eaf7c99dd
commit 6a03577605
4 changed files with 39 additions and 0 deletions

View File

@@ -61,6 +61,13 @@ class TestAPI:
json=RetrieveJSONFromFile("data/GetAccountsSearch.json"))
data = c.get_accounts(search="number:38-9011-0510023-03",params={'page': 1, 'limit': 200})
def test_get_account_search_not_found(self, setUp, requests_mock):
c = setUp
requests_mock.get(c.url + "/accounts?search=number%3Aarandomvalue&company_id=1",
json=RetrieveJSONFromFile("data/GetAccountsSearchNotFound.json"))
with pytest.raises(AccountNotFound):
data = c.get_accounts(search="number:arandomvalue")
def test_create_transaction_income_success(self, setUp, requests_mock,
type='income', # Payment method type
account_id=2, # Account ID to assign