Limit big numbers to the last 7 days

Implements and depends on:
- https://github.com/alphagov/notifications-api/pull/241
This commit is contained in:
Chris Hill-Scott
2016-04-19 17:02:49 +01:00
parent 5bf0d8fe70
commit be7c7cebbc
4 changed files with 8 additions and 9 deletions

View File

@@ -77,7 +77,7 @@ 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')

View File

@@ -172,7 +172,7 @@ def mock_delete_service(mocker, mock_get_service):
@pytest.fixture(scope='function')
def mock_get_service_statistics(mocker):
def _create(service_id):
def _create(service_id, limit_days=None):
return {'data': [{}]}
return mocker.patch(