From 51a5a4b559c141dea9459c11460abf1e95a919f0 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 27 Mar 2020 14:50:02 +0000 Subject: [PATCH] Remove unused client method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The app is now always getting an organisation by its `id` (or domain), and never by `service_id`. This means that the client method and associated mocking can be removed. I think this must come from a time when the service response didn’t include `organisation_id`, but now it always does. --- app/notify_client/organisations_api_client.py | 3 --- tests/conftest.py | 16 ---------------- 2 files changed, 19 deletions(-) diff --git a/app/notify_client/organisations_api_client.py b/app/notify_client/organisations_api_client.py index f30fe009b..617859cba 100644 --- a/app/notify_client/organisations_api_client.py +++ b/app/notify_client/organisations_api_client.py @@ -62,9 +62,6 @@ class OrganisationsClient(NotifyAdminAPIClient): def update_organisation_name(self, org_id, name): return self.update_organisation(org_id, name=name) - def get_service_organisation(self, service_id): - return self.get(url="/service/{}/organisation".format(service_id)) - @cache.delete('service-{service_id}') @cache.delete('live-service-and-organisation-counts') def update_service_organisation(self, service_id, org_id): diff --git a/tests/conftest.py b/tests/conftest.py index 2babc5429..fcee81d7a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3138,22 +3138,6 @@ def mock_get_no_organisation_by_domain(mocker): ) -@pytest.fixture(scope='function') -def mock_get_service_organisation( - mocker, - agreement_signed=None, - organisation_type=None, -): - def _get_service_organisation(service_id): - return organisation_json( - '7aa5d4e9-4385-4488-a489-07812ba13383', - agreement_signed=None, - organisation_type=None, - ) - - return mocker.patch('app.organisations_client.get_service_organisation', side_effect=_get_service_organisation) - - @pytest.fixture(scope='function') def mock_update_service_organisation(mocker): def _update_service_organisation(service_id, organisation_id):