Because dates are confusing we need to fix this query once more.

The template statistics are returning 7 days inclusive, however the big numbers on the dashboard are for 8 days.
This PR fixes that.
This commit is contained in:
Rebecca Law
2018-05-01 10:47:47 +01:00
parent ea2fd286b5
commit 93c7ab6251
2 changed files with 6 additions and 4 deletions

View File

@@ -628,13 +628,13 @@ def test_fetch_stats_for_today_only_includes_today(notify_db, notify_db_session,
def test_fetch_stats_should_not_gather_notifications_older_than_7_days(notify_db, notify_db_session, sample_template):
# 8 days ago
create_notification(notify_db, None, to_field='1', status='delivered', created_at='2001-01-01T12:00:00')
create_notification(notify_db, None, to_field='1', status='delivered', created_at='2001-01-02T12:00:00')
# 7 days ago, 2hours ago
create_notification(notify_db, None, to_field='2', status='failed', created_at='2001-01-02T10:00:00')
create_notification(notify_db, None, to_field='2', status='failed', created_at='2001-01-03T10:00:00')
# 7 days ago
create_notification(notify_db, None, to_field='2', status='failed', created_at='2001-01-02T12:00:00')
create_notification(notify_db, None, to_field='2', status='failed', created_at='2001-01-03T12:00:00')
# right_now
create_notification(notify_db, None, to_field='3', status='created', created_at='2001-01-09T12:00:00')