diff --git a/app/notify_client/service_api_client.py b/app/notify_client/service_api_client.py index ac068dd8f..a3dfbcc40 100644 --- a/app/notify_client/service_api_client.py +++ b/app/notify_client/service_api_client.py @@ -109,12 +109,12 @@ class ServiceAPIClient(NotifyAdminAPIClient): 'go_live_user', 'go_live_at', 'rate_limit', + 'notes', } if disallowed_attributes: raise TypeError('Not allowed to update service attributes: {}'.format( ", ".join(disallowed_attributes) )) - endpoint = "/service/{0}".format(service_id) return self.post(endpoint, data) diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index 1bf7779ed..932049a96 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -5260,3 +5260,22 @@ def test_view_edit_service_notes( page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser') assert page.select_one('h1').text == "Edit service notes" assert page.find('label', class_="form-label").text.strip() == "Notes" + + +def test_update_service_notes( + platform_admin_client, + service_one, + mock_update_service +): + response = platform_admin_client.post( + url_for( + 'main.edit_service_notes', + service_id=SERVICE_ONE_ID, + ), + data={'notes': "Very fluffy"} + ) + assert response.status_code == 302 + settings_url = url_for( + 'main.service_settings', service_id=SERVICE_ONE_ID, _external=True) + assert settings_url == response.location + mock_update_service.assert_called_with(SERVICE_ONE_ID, notes="Very fluffy")