add day filter to template usage dao, and remove NotificationHistory

we should be very careful with when we get data from
NotificationHistory - this should probably only be from scheduled
tasks. `dao_get_template_usage` is only called from the template
statistics rest endpoint, so shouldn't ever hit template history.

also, moved tests out to new file to break up the 2k test file a bit
This commit is contained in:
Leo Hemsted
2018-04-11 18:17:29 +01:00
parent 901383777b
commit 67019fc5a1
4 changed files with 208 additions and 342 deletions

View File

@@ -35,7 +35,7 @@ def get_template_statistics_for_service_by_day(service_id):
message = {'limit_days': [error]}
raise InvalidRequest(message, status_code=400)
else:
limit_days = None
limit_days = 7
if limit_days == 7:
stats = get_template_statistics_for_7_days(limit_days, service_id)