Merge pull request #499 from alphagov/dashboard-duration

Fix the big numbers on the dashboard
This commit is contained in:
Chris Hill-Scott
2016-04-25 15:32:54 +01:00
4 changed files with 25 additions and 5 deletions

View File

@@ -14,4 +14,18 @@ def test_notifications_statistics_client_calls_correct_api_endpoint(mocker, api_
client.get_statistics_for_service(some_service_id)
mock_get.assert_called_once_with(url=expected_url)
mock_get.assert_called_once_with(url=expected_url, params={})
def test_notifications_statistics_client_calls_correct_api_endpoint_with_params(mocker, api_user_active):
some_service_id = uuid.uuid4()
expected_url = '/service/{}/notifications-statistics'.format(some_service_id)
client = StatisticsApiClient()
mock_get = mocker.patch('app.notify_client.statistics_api_client.StatisticsApiClient.get')
client.get_statistics_for_service(some_service_id, limit_days=99)
mock_get.assert_called_once_with(url=expected_url, params={'limit_days': 99})