|
2 | 2 |
|
3 | 3 |
|
4 | 4 | def test_aggregate_transactions_category_filter_runs(firestore_client, sample_wallet_id): |
5 | | - """Aggregate by category (matches the `run.py` example for "Étkezés"). |
| 5 | + """Aggregate by category. |
6 | 6 |
|
7 | 7 | Verifies the call completes and returns a float value. |
8 | 8 | """ |
9 | 9 | total = firestore_client.aggregate_transactions( |
10 | 10 | wallet_id=sample_wallet_id, |
11 | | - start='2025-08-01T00:00:00Z', |
12 | | - end='2025-08-31T23:59:59Z', |
13 | | - #filters=[{"field": "category", "op": "=", "value": "Étkezés"}], |
14 | | - #filters=[TransactionFilter(field="category", op="=", value="Étkezés")], |
15 | | - filters={"category__eq": "Étkezés"}, |
| 11 | + start='2025-11-17T00:00:00Z', |
| 12 | + end='2025-11-17T23:59:59Z', |
| 13 | + filters={"category__eq": "Groceries"}, |
16 | 14 | ) |
17 | 15 |
|
18 | 16 | assert isinstance(total, float) |
19 | | - assert total > -180000 |
20 | | - assert total < -3000 |
| 17 | + assert total == -4.0 |
21 | 18 |
|
22 | 19 |
|
23 | 20 | def test_aggregate_transactions_label_filter_runs(firestore_client, sample_wallet_id): |
24 | | - """Aggregate by label (matches the `run.py` example for label `szigetspicc`). |
| 21 | + """Aggregate by label. |
25 | 22 |
|
26 | 23 | Verifies the call completes and returns a float value. |
27 | 24 | """ |
28 | 25 | total = firestore_client.aggregate_transactions( |
29 | 26 | wallet_id=sample_wallet_id, |
30 | | - start='2025-08-01T00:00:00Z', |
31 | | - end='2025-08-31T23:59:59Z', |
32 | | - #filters=[{"field": "labels", "op": "array-contains", "value": "szigetspicc"}], |
33 | | - #filters=[TransactionFilter(field="labels", op="array-contains", value="szigetspicc")], |
34 | | - filters={"labels__contains": "szigetspicc"}, |
| 27 | + start='2025-11-17T00:00:00Z', |
| 28 | + end='2025-11-17T23:59:59Z', |
| 29 | + filters={"labels__contains": "Coffee ☕"}, |
35 | 30 | ) |
36 | 31 |
|
37 | 32 | assert isinstance(total, float) |
38 | | - assert total > -80000 |
39 | | - assert total < -5000 |
| 33 | + assert total == -4.0 |
0 commit comments