Fix aggregate stats dao function to use start_date

Now using start_date to determine which table to query.
This commit is contained in:
Katie Smith
2018-07-03 09:26:02 +01:00
parent e1a7d99c72
commit 4228b77ebb
2 changed files with 1 additions and 15 deletions

View File

@@ -1982,17 +1982,3 @@ def test_fetch_aggregate_stats_by_date_range_for_all_services_uses_bst_date(samp
assert len(result) == 1
assert result[0].status == 'sent'
@freeze_time('2018-01-08T12:00:00')
def test_fetch_aggregate_stats_by_date_range_for_all_services_gets_test_notifications_when_start_date_over_7_days_ago(
sample_template
):
ten_days_ago = datetime.utcnow().date() - timedelta(days=10)
today = datetime.utcnow().date()
create_notification(sample_template, key_type=KEY_TYPE_TEST, created_at=datetime.utcnow())
result = fetch_aggregate_stats_by_date_range_for_all_services(ten_days_ago, today)
assert len(result) == 1