mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 16:24:08 -04:00
Merge pull request #471 from alphagov/craig-david
Show the last 7 days of statistics on the dashboard
This commit is contained in:
@@ -77,15 +77,15 @@ def test_should_show_recent_templates_on_dashboard(app_,
|
||||
|
||||
assert response.status_code == 200
|
||||
response.get_data(as_text=True)
|
||||
mock_get_service_statistics.assert_called_once_with(SERVICE_ONE_ID)
|
||||
mock_get_service_statistics.assert_called_once_with(SERVICE_ONE_ID, limit_days=7)
|
||||
mock_template_stats.assert_called_once_with(SERVICE_ONE_ID)
|
||||
|
||||
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
||||
headers = [header.text.strip() for header in page.find_all('h2')]
|
||||
assert 'Test Service' in headers
|
||||
assert 'Sent today' in headers
|
||||
assert 'In the last 7 days' in headers
|
||||
template_usage_headers = [th.text.strip() for th in page.thead.find_all('th')]
|
||||
for th in ['Template', 'Type', 'Messages sent']:
|
||||
for th in ['Template', 'Type', 'Messages processed']:
|
||||
assert th in template_usage_headers
|
||||
table_rows = page.tbody.find_all('tr')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user