mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 18:01:08 -05:00
Align date range for template + notification stats
We were using two different queries to filter template stats to the past 7 days, plus today. Since we’re storing both as short dates, we can now use the same query for both. 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 -------|---------|-----------|----------|--------|----------|--------|------- Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | Sunday | Monday So if we are on Monday, the stats should include today, plus everything back to last Monday. Previously the template stats query was only going back to the Tuesday. This should mean the numbers on the dashboard always line up.
This commit is contained in:
@@ -35,7 +35,7 @@ def test_get_template_statistics_for_service_for_last_week(notify_api, sample_te
|
||||
|
||||
assert response.status_code == 200
|
||||
json_resp = json.loads(response.get_data(as_text=True))
|
||||
assert len(json_resp['data']) == 7
|
||||
assert len(json_resp['data']) == 8
|
||||
assert json_resp['data'][0]['day'] == '2016-04-09'
|
||||
assert json_resp['data'][6]['day'] == '2016-04-03'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user