mirror of
https://github.com/elisiariocouto/leggen.git
synced 2025-12-13 13:42:19 +00:00
Fix tests.
This commit is contained in:
@@ -153,8 +153,8 @@ class TestTransactionsAPI:
|
|||||||
"min_amount=-50.0&"
|
"min_amount=-50.0&"
|
||||||
"max_amount=0.0&"
|
"max_amount=0.0&"
|
||||||
"search=Coffee&"
|
"search=Coffee&"
|
||||||
"limit=10&"
|
"page=2&"
|
||||||
"offset=5"
|
"per_page=10"
|
||||||
)
|
)
|
||||||
|
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
@@ -165,7 +165,7 @@ class TestTransactionsAPI:
|
|||||||
mock_get_transactions.assert_called_once_with(
|
mock_get_transactions.assert_called_once_with(
|
||||||
account_id="test-account-123",
|
account_id="test-account-123",
|
||||||
limit=10,
|
limit=10,
|
||||||
offset=5,
|
offset=10, # (page-1) * per_page = (2-1) * 10 = 10
|
||||||
date_from="2025-09-01",
|
date_from="2025-09-01",
|
||||||
date_to="2025-09-02",
|
date_to="2025-09-02",
|
||||||
min_amount=-50.0,
|
min_amount=-50.0,
|
||||||
@@ -194,7 +194,9 @@ class TestTransactionsAPI:
|
|||||||
data = response.json()
|
data = response.json()
|
||||||
assert data["success"] is True
|
assert data["success"] is True
|
||||||
assert len(data["data"]) == 0
|
assert len(data["data"]) == 0
|
||||||
assert "0 transactions" in data["message"]
|
assert data["pagination"]["total"] == 0
|
||||||
|
assert data["pagination"]["page"] == 1
|
||||||
|
assert data["pagination"]["total_pages"] == 0
|
||||||
|
|
||||||
def test_get_transactions_database_error(
|
def test_get_transactions_database_error(
|
||||||
self, api_client, mock_config, mock_auth_token
|
self, api_client, mock_config, mock_auth_token
|
||||||
|
|||||||
Reference in New Issue
Block a user