From fb36404b6c5a8843c3ca348a52002471f8263a6e Mon Sep 17 00:00:00 2001 From: Katie Smith Date: Wed, 12 Aug 2020 18:30:00 +0100 Subject: [PATCH 1/2] Fix error message when invitation has expired The error message for when an invitation to Notify had expired was displaying in admin with square brackets round it because admin is not expecting the message to be a list (https://github.com/alphagov/notifications-admin/blob/a85134ee227a89fbe13ee470a7b74b69e01ad7e2/app/models/user.py#L500) --- app/accept_invite/rest.py | 4 ++-- tests/app/accept_invite/test_accept_invite_rest.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/accept_invite/rest.py b/app/accept_invite/rest.py index a6ac0773b..0485fc58a 100644 --- a/app/accept_invite/rest.py +++ b/app/accept_invite/rest.py @@ -35,8 +35,8 @@ def validate_invitation_token(invitation_type, token): max_age_seconds) except SignatureExpired: errors = {'invitation': - ['Your invitation to GOV.UK Notify has expired. ' - 'Please ask the person that invited you to send you another one']} + 'Your invitation to GOV.UK Notify has expired. ' + 'Please ask the person that invited you to send you another one'} raise InvalidRequest(errors, status_code=400) except BadData: errors = {'invitation': 'Something’s wrong with this link. Make sure you’ve copied the whole thing.'} diff --git a/tests/app/accept_invite/test_accept_invite_rest.py b/tests/app/accept_invite/test_accept_invite_rest.py index f0c806473..a351eb4de 100644 --- a/tests/app/accept_invite/test_accept_invite_rest.py +++ b/tests/app/accept_invite/test_accept_invite_rest.py @@ -19,9 +19,9 @@ def test_validate_invitation_token_for_expired_token_returns_400(client, invitat assert response.status_code == 400 json_resp = json.loads(response.get_data(as_text=True)) assert json_resp['result'] == 'error' - assert json_resp['message'] == {'invitation': [ - 'Your invitation to GOV.UK Notify has expired. ' - 'Please ask the person that invited you to send you another one']} + assert json_resp['message'] == { + 'invitation': 'Your invitation to GOV.UK Notify has expired. ' + 'Please ask the person that invited you to send you another one'} @pytest.mark.parametrize('invitation_type', ['service', 'organisation']) From f47e9116d61dda931e3633979cf8239904e8e8fb Mon Sep 17 00:00:00 2001 From: Katie Smith Date: Thu, 13 Aug 2020 09:54:03 +0100 Subject: [PATCH 2/2] Delete test for Redis config in sandbox We don't use separate config per environment for Redis now. --- tests/app/test_config.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/app/test_config.py b/tests/app/test_config.py index b6918c8fd..fae5919fa 100644 --- a/tests/app/test_config.py +++ b/tests/app/test_config.py @@ -57,11 +57,6 @@ def test_load_config_if_cloudfoundry_not_available(reload_config): assert config.Config.ADMIN_BASE_URL == 'env' -def test_cloudfoundry_config_has_different_defaults(): - # these should always be set on Sandbox - assert config.Sandbox.REDIS_ENABLED is False - - def test_queue_names_all_queues_correct(): # Need to ensure that all_queues() only returns queue names used in API queues = QueueNames.all_queues()