diff --git a/app/notify_client/organisations_api_client.py b/app/notify_client/organisations_api_client.py index 13e3b774a..467ab6791 100644 --- a/app/notify_client/organisations_api_client.py +++ b/app/notify_client/organisations_api_client.py @@ -81,12 +81,6 @@ class OrganisationsClient(NotifyAdminAPIClient): data = _attach_current_user({}) return self.delete(endpoint, data) - def is_organisation_name_unique(self, org_id, name): - return self.get( - url="/organisations/unique", - params={"org_id": org_id, "name": name} - )["result"] - def get_services_and_usage(self, org_id, year): return self.get( url=f"/organisations/{org_id}/services-with-usage", diff --git a/app/notify_client/service_api_client.py b/app/notify_client/service_api_client.py index f610700a9..9dde58ffd 100644 --- a/app/notify_client/service_api_client.py +++ b/app/notify_client/service_api_client.py @@ -319,14 +319,6 @@ class ServiceAPIClient(NotifyAdminAPIClient): self._delete_template_cache_for_service(service_id) return self.post(endpoint, data=data) - def is_service_name_unique(self, service_id, name, email_from): - """ - Check that the service name or email from are unique across all services. - """ - endpoint = "/service/unique" - params = {"service_id": service_id, "name": name, "email_from": email_from} - return self.get(url=endpoint, params=params)["result"] - # Temp access of service history data. Includes service and api key history def get_service_history(self, service_id): return self.get('/service/{0}/history'.format(service_id))['data'] diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index 6b565743d..11cf90c28 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -539,7 +539,6 @@ def test_should_show_service_name_with_no_prefixing( def test_should_not_hit_api_if_service_name_hasnt_changed( client_request, mock_update_service, - mock_service_name_is_unique, ): client_request.post( 'main.service_name_change', diff --git a/tests/conftest.py b/tests/conftest.py index fda7e4779..69bb391a5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -549,16 +549,6 @@ def mock_get_detailed_services(mocker, fake_uuid): return mocker.patch('app.service_api_client.get_services', return_value=services) -@pytest.fixture(scope='function') -def mock_service_name_is_not_unique(mocker): - return mocker.patch('app.service_api_client.is_service_name_unique', return_value=False) - - -@pytest.fixture(scope='function') -def mock_service_name_is_unique(mocker): - return mocker.patch('app.service_api_client.is_service_name_unique', return_value=True) - - @pytest.fixture(scope='function') def mock_get_live_service(mocker, api_user_active): def _get(service_id): @@ -3348,16 +3338,6 @@ def mock_add_user_to_organisation(mocker, organisation_one, api_user_active): return mocker.patch('app.user_api_client.add_user_to_organisation', side_effect=_add_user) -@pytest.fixture(scope='function') -def mock_organisation_name_is_not_unique(mocker): - return mocker.patch('app.organisations_client.is_organisation_name_unique', return_value=False) - - -@pytest.fixture(scope='function') -def mock_organisation_name_is_unique(mocker): - return mocker.patch('app.organisations_client.is_organisation_name_unique', return_value=True) - - @pytest.fixture(scope='function') def mock_update_organisation(mocker): def _update_org(org, **kwargs):