mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-19 14:08:47 -04:00
Update error message for invalid email addresses
It has a trailing full stop since: https://github.com/alphagov/notifications-utils/pull/76
This commit is contained in:
@@ -85,7 +85,7 @@ def test_create_invited_user_invalid_email(notify_api, sample_service, mocker):
|
|||||||
assert response.status_code == 400
|
assert response.status_code == 400
|
||||||
json_resp = json.loads(response.get_data(as_text=True))
|
json_resp = json.loads(response.get_data(as_text=True))
|
||||||
assert json_resp['result'] == 'error'
|
assert json_resp['result'] == 'error'
|
||||||
assert json_resp['message'] == {'email_address': ['Not a valid email address']}
|
assert json_resp['message'] == {'email_address': ['Not a valid email address.']}
|
||||||
app.celery.tasks.send_email.apply_async.assert_not_called()
|
app.celery.tasks.send_email.apply_async.assert_not_called()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ def test_should_reject_email_notification_with_bad_email(notify_api, sample_emai
|
|||||||
mocked.apply_async.assert_not_called()
|
mocked.apply_async.assert_not_called()
|
||||||
assert response.status_code == 400
|
assert response.status_code == 400
|
||||||
assert data['result'] == 'error'
|
assert data['result'] == 'error'
|
||||||
assert data['message']['to'][0] == 'Not a valid email address'
|
assert data['message']['to'][0] == 'Not a valid email address.'
|
||||||
|
|
||||||
|
|
||||||
@freeze_time("2016-01-01 11:09:00.061258")
|
@freeze_time("2016-01-01 11:09:00.061258")
|
||||||
@@ -913,7 +913,7 @@ def test_create_template_raises_invalid_request_exception_with_missing_personali
|
|||||||
from app.notifications.rest import create_template_object_for_notification
|
from app.notifications.rest import create_template_object_for_notification
|
||||||
with pytest.raises(InvalidRequest) as e:
|
with pytest.raises(InvalidRequest) as e:
|
||||||
create_template_object_for_notification(template, {})
|
create_template_object_for_notification(template, {})
|
||||||
assert {'template': ['Missing personalisation: name']} == e.value.message
|
assert {'template': ['Missing personalisation: Name']} == e.value.message
|
||||||
|
|
||||||
|
|
||||||
def test_create_template_raises_invalid_request_exception_with_too_much_personalisation_data(
|
def test_create_template_raises_invalid_request_exception_with_too_much_personalisation_data(
|
||||||
|
|||||||
@@ -470,7 +470,7 @@ def test_send_user_reset_password_should_return_400_when_data_is_not_email_addre
|
|||||||
headers=[('Content-Type', 'application/json'), auth_header])
|
headers=[('Content-Type', 'application/json'), auth_header])
|
||||||
|
|
||||||
assert resp.status_code == 400
|
assert resp.status_code == 400
|
||||||
assert json.loads(resp.get_data(as_text=True))['message'] == {'email': ['Not a valid email address']}
|
assert json.loads(resp.get_data(as_text=True))['message'] == {'email': ['Not a valid email address.']}
|
||||||
|
|
||||||
|
|
||||||
@freeze_time("2016-01-01 11:09:00.061258")
|
@freeze_time("2016-01-01 11:09:00.061258")
|
||||||
|
|||||||
Reference in New Issue
Block a user