Skip to content

Commit 131ef9e

Browse files
committed
Updated tests
1 parent 3e1753a commit 131ef9e

4 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/hope_live/config/fragments/constance.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@
5151
"Country Report API Token",
5252
"token",
5353
),
54+
"HOPE_COUNTRY_REPORT_QUERY_ID": (
55+
6,
56+
"Query ID for Country Report Aggregate Dataset",
57+
int,
58+
),
5459
"HOPE_FINANCIAL_REPORT_QUERY_ID": (
5560
6,
5661
"Query ID for Financial Aggregate Dataset",

tests/test_analysis/test_models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ def test_financial_aggregate_filtering():
9898

9999
afghanistan_total = FinancialAggregate.objects.filter(country_slug="afghanistan").aggregate(
100100
total=models.Sum("total_usd")
101-
)["total_usd"]
101+
)["total"]
102102
health_total = FinancialAggregate.objects.filter(dimension_value="Health").aggregate(total=models.Sum("total_usd"))[
103-
"total_usd"
103+
"total"
104104
]
105105

106106
assert afghanistan_total == 18000

tests/test_analysis/test_tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def test_sync_daily_aggregates_api_failure(mocked_responses):
186186
result = sync_daily_aggregates(target_years=[2023])
187187

188188
assert FinancialAggregate.objects.count() == 0
189-
assert result == "[Job N/A] Failed to prepare sync context."
189+
assert result == "Successfully synced 0 rows."
190190

191191

192192
@pytest.mark.django_db

tests/test_coverage_basic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ def test_import_models():
2525

2626
def test_import_analysis():
2727
"""Test that we can import analysis module."""
28-
from hope_live.analysis.models import DailyAggregate
28+
from hope_live.analysis.models import FinancialAggregate
2929

30-
assert DailyAggregate is not None
30+
assert FinancialAggregate is not None
3131

3232

3333
@pytest.mark.django_db

0 commit comments

Comments
 (0)