Fixed bug in test which was passing but not testing the services_dao

correctly

The dao_fetch_monthly_historical_usage_by_template_for_service code
wasn't being tested properly due to an bug on the test which created a
notification with the same template and hence was not testing that
a specific service would have a different template id.

- Fixed the bug in the test
- Update services_dao so that the service id check is made
This commit is contained in:
Richard Chapman
2017-11-21 10:53:29 +00:00
parent adaadefed5
commit f91c0a820f
2 changed files with 9 additions and 1 deletions

View File

@@ -576,6 +576,7 @@ def dao_fetch_monthly_historical_usage_by_template_for_service(service_id, year)
Template, Notification.template_id == Template.id,
).filter(
Notification.created_at >= start_date,
Notification.service_id == service_id
).group_by(
Notification.template_id,
Template.name,