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
(a85134ee22/app/models/user.py (L500))
This commit is contained in:
Katie Smith
2020-08-12 18:30:00 +01:00
parent e91252ad43
commit fb36404b6c
2 changed files with 5 additions and 5 deletions

View File

@@ -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'])