From dd85cf076d259dd6709bb7c687ac881d2e4e6f8f Mon Sep 17 00:00:00 2001 From: Ben Thorner Date: Thu, 24 Mar 2022 12:28:14 +0000 Subject: [PATCH] Fix test for broadcast service with realistic user Previously the user had permissions like "manage_users", which can't currently be set in the UI. --- tests/app/test_navigation.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/app/test_navigation.py b/tests/app/test_navigation.py index 8477a9581..01e3769bf 100644 --- a/tests/app/test_navigation.py +++ b/tests/app/test_navigation.py @@ -521,13 +521,20 @@ def test_navigation_urls( def test_navigation_for_services_with_broadcast_permission( + mocker, client_request, service_one, mock_get_service_templates, mock_get_template_folders, mock_get_api_keys, + active_user_create_broadcasts_permission, ): service_one['permissions'] += ['broadcast'] + mocker.patch( + 'app.user_api_client.get_user', + return_value=active_user_create_broadcasts_permission + ) + page = client_request.get('main.choose_template', service_id=SERVICE_ONE_ID) assert [ a['href'] for a in page.select('.navigation a') @@ -537,7 +544,6 @@ def test_navigation_for_services_with_broadcast_permission( '/services/{}/rejected-alerts'.format(SERVICE_ONE_ID), '/services/{}/templates'.format(SERVICE_ONE_ID), '/services/{}/users'.format(SERVICE_ONE_ID), - '/services/{}/service-settings'.format(SERVICE_ONE_ID), ]