Add API client method to fetch service data retention by type

This commit is contained in:
Alexey Bezhan
2018-08-13 17:06:16 +01:00
parent 28b03fe748
commit 52d48ad679
3 changed files with 23 additions and 0 deletions

View File

@@ -70,6 +70,7 @@ def test_can_show_notifications(
service_one,
mock_get_notifications,
mock_get_service_statistics,
mock_get_service_data_retention_by_notification_type,
mock_has_no_jobs,
user,
extra_args,
@@ -194,6 +195,7 @@ def test_link_to_download_notifications(
fake_uuid,
mock_get_notifications,
mock_get_service_statistics,
mock_get_service_data_retention_by_notification_type,
mock_has_no_jobs,
user,
query_parameters,
@@ -229,6 +231,7 @@ def test_letters_with_status_virus_scan_failed_shows_a_failure_description(
logged_in_client,
service_one,
mock_get_service_statistics,
mock_get_service_data_retention_by_notification_type,
):
mock_get_notifications(
mocker,
@@ -258,6 +261,7 @@ def test_should_not_show_preview_link_for_precompiled_letters_in_virus_states(
logged_in_client,
service_one,
mock_get_service_statistics,
mock_get_service_data_retention_by_notification_type,
letter_status,
):
mock_get_notifications(
@@ -280,6 +284,7 @@ def test_should_not_show_preview_link_for_precompiled_letters_in_virus_states(
def test_shows_message_when_no_notifications(
client_request,
mock_get_service_statistics,
mock_get_service_data_retention_by_notification_type,
mock_get_notifications_with_no_notifications,
):
@@ -341,6 +346,7 @@ def test_search_recipient_form(
logged_in_client,
mock_get_notifications,
mock_get_service_statistics,
mock_get_service_data_retention_by_notification_type,
initial_query_arguments,
form_post_data,
expected_search_box_label,
@@ -382,6 +388,7 @@ def test_should_show_notifications_for_a_service_with_next_previous(
active_user_with_permissions,
mock_get_notifications_with_previous_next,
mock_get_service_statistics,
mock_get_service_data_retention_by_notification_type,
mocker,
):
response = logged_in_client.get(url_for(
@@ -462,6 +469,7 @@ def test_html_contains_notification_id(
active_user_with_permissions,
mock_get_notifications,
mock_get_service_statistics,
mock_get_service_data_retention_by_notification_type,
mocker,
):
response = logged_in_client.get(url_for(
@@ -482,6 +490,7 @@ def test_redacts_templates_that_should_be_redacted(
mocker,
active_user_with_permissions,
mock_get_service_statistics,
mock_get_service_data_retention_by_notification_type,
):
mock_get_notifications(
mocker,
@@ -514,6 +523,7 @@ def test_big_numbers_and_search_dont_show_for_letters(
mock_get_notifications,
active_user_with_permissions,
mock_get_service_statistics,
mock_get_service_data_retention_by_notification_type,
message_type,
tablist_visible,
search_bar_visible
@@ -543,6 +553,7 @@ def test_sending_status_hint_does_not_include_status_for_letters(
service_one,
active_user_with_permissions,
mock_get_service_statistics,
mock_get_service_data_retention_by_notification_type,
message_type,
hint_status_visible,
mocker
@@ -570,6 +581,7 @@ def test_should_expected_hint_for_letters(
service_one,
active_user_with_permissions,
mock_get_service_statistics,
mock_get_service_data_retention_by_notification_type,
mocker,
fake_uuid,
is_precompiled_letter,

View File

@@ -533,6 +533,14 @@ def mock_get_service_statistics(mocker, api_user_active):
return mocker.patch('app.service_api_client.get_service_statistics', side_effect=_get)
@pytest.fixture(scope='function')
def mock_get_service_data_retention_by_notification_type(mocker, api_user_active):
def _get(service_id, notification_type):
return {}
return mocker.patch('app.service_api_client.get_service_data_retention_by_notification_type', side_effect=_get)
@pytest.fixture(scope='function')
def mock_get_detailed_services(mocker, fake_uuid):
service_one = service_json(