Put some statistics on the dashboard

This commit adds two new sections to the dashboard

1. A banner telling you about trial mode, including a count of how many messages
   you have left today, which is a restriction of trial mode

2. Panels with counts of how many emails and text messages have been sent in a
   day, plus the failure rates for each

It does **not**:
- link through to any further information about what trial mode is (coming
  later)
- link through to pages for the failure rates (coming later)
- change the ‘recent jobs’ section to ‘recent notifications’
This commit is contained in:
Chris Hill-Scott
2016-03-17 11:45:48 +00:00
parent d04bde5486
commit b38ae08ad6
17 changed files with 268 additions and 99 deletions

View File

@@ -157,7 +157,7 @@ def mock_delete_service(mocker, mock_get_service):
@pytest.fixture(scope='function')
def mock_get_service_statistics(mocker):
def _create(service_id):
return {'data': []}
return {'data': [{}]}
return mocker.patch(
'app.statistics_api_client.get_statistics_for_service', side_effect=_create)