Reduced the size of the pull request by only dealing with adding the data retention form.

This commit is contained in:
Rebecca Law
2018-08-06 16:04:31 +01:00
parent ae1f1c95d6
commit 18750585c4
6 changed files with 12 additions and 40 deletions

View File

@@ -384,7 +384,7 @@ def test_upload_csvfile_with_errors_shows_check_page_with_errors(
mock_get_service_template_with_placeholders,
mock_s3_upload,
mock_get_users_by_service,
mock_get_service_statistics_for_today,
mock_get_service_statistics,
mock_get_job_doesnt_exist,
fake_uuid,
):
@@ -509,7 +509,7 @@ def test_upload_csvfile_with_missing_columns_shows_error(
mock_get_service_template_with_placeholders,
mock_s3_upload,
mock_get_users_by_service,
mock_get_service_statistics_for_today,
mock_get_service_statistics,
mock_get_job_doesnt_exist,
service_one,
fake_uuid,
@@ -590,7 +590,7 @@ def test_upload_valid_csv_shows_preview_and_table(
mock_get_live_service,
mock_get_service_template_with_placeholders,
mock_get_users_by_service,
mock_get_service_statistics_for_today,
mock_get_service_statistics,
mock_get_job_doesnt_exist,
mock_s3_set_metadata,
fake_uuid,

View File

@@ -35,24 +35,15 @@ def test_client_gets_service(mocker):
mock_get.assert_called_once_with('/service/foo')
def test_client_gets_service_statistics(mocker):
@pytest.mark.parametrize('today_only', [True, False])
def test_client_gets_service_statistics(mocker, today_only):
client = ServiceAPIClient()
mock_get = mocker.patch.object(client, 'get', return_value={'data': {'a': 'b'}})
ret = client.get_service_statistics('foo')
ret = client.get_service_statistics('foo', today_only)
assert ret == {'a': 'b'}
mock_get.assert_called_once_with('/service/foo/statistics')
def test_client_gets_service_statistics_for_today(mocker):
client = ServiceAPIClient()
mock_get = mocker.patch.object(client, 'get', return_value={'data': {'a': 'b'}})
ret = client.get_service_statistics_for_today('foo')
assert ret == {'a': 'b'}
mock_get.assert_called_once_with('/service/foo/statistics', params={'today_only': True})
mock_get.assert_called_once_with('/service/foo/statistics', params={'today_only': today_only})
def test_client_only_updates_allowed_attributes(mocker):