Template usage always aggregating today's stats

Added a check to ensure that the current date falls in between the
financial year for the year supplied by the method, so that the todays
stats will only be appended in that situation.
This commit is contained in:
Richard Chapman
2017-11-21 16:29:20 +00:00
parent f91c0a820f
commit 3ac7507f3b
2 changed files with 48 additions and 38 deletions

View File

@@ -1471,6 +1471,13 @@ def test_dao_fetch_monthly_historical_usage_by_template_for_service_returns_fina
assert result[4].month == 3
assert result[4].year == 2018
result = sorted(
dao_fetch_monthly_historical_usage_by_template_for_service(n.service_id, 2014),
key=lambda x: (x.year, x.month)
)
assert len(result) == 0
@freeze_time("2018-03-10 11:09:00.000000")
def test_dao_fetch_monthly_historical_usage_by_template_for_service_only_returns_for_service(