You've already forked akaunting-py
Added test for searching account
This commit is contained in:
34
data/GetAccountsSearch.json
Normal file
34
data/GetAccountsSearch.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"data":[
|
||||
{
|
||||
"id":2,
|
||||
"company_id":1,
|
||||
"name":"Some Account",
|
||||
"number":"**-9011-*******-03",
|
||||
"currency_code":"NZD",
|
||||
"opening_balance":0,
|
||||
"opening_balance_formatted":"$0.00",
|
||||
"current_balance":100,
|
||||
"current_balance_formatted":"$100.00",
|
||||
"bank_name":"A Bank",
|
||||
"bank_phone":"None",
|
||||
"bank_address":"None",
|
||||
"enabled":true,
|
||||
"created_by":1,
|
||||
"created_at":"2022-05-13T16:16:16+12:00",
|
||||
"updated_at":"2022-05-13T16:16:16+12:00"
|
||||
}
|
||||
],
|
||||
"meta":{
|
||||
"pagination":{
|
||||
"total":1,
|
||||
"count":1,
|
||||
"per_page":25,
|
||||
"current_page":1,
|
||||
"total_pages":1,
|
||||
"links":{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,6 +55,12 @@ class TestAPI:
|
||||
json=RetrieveJSONFromFile("data/GetAccountsList.json"))
|
||||
data = c.get_accounts(params={'page': 1, 'limit': 200})
|
||||
|
||||
def test_get_account_search(self, setUp, requests_mock):
|
||||
c = setUp
|
||||
requests_mock.get(c.url + "/accounts?search=number%3A38-9011-0510023-03¶ms=page¶ms=limit&company_id=1",
|
||||
json=RetrieveJSONFromFile("data/GetAccountsSearch.json"))
|
||||
data = c.get_accounts(search="number:38-9011-0510023-03",params={'page': 1, 'limit': 200})
|
||||
|
||||
def test_create_transaction_income_success(self, setUp, requests_mock,
|
||||
type='income', # Payment method type
|
||||
account_id=2, # Account ID to assign
|
||||
|
||||
Reference in New Issue
Block a user