mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 02:11:11 -05:00
Fix extra space in test
This commit is contained in:
@@ -543,28 +543,28 @@ def test_send_already_registered_email_returns_400_when_data_is_missing(notify_a
|
|||||||
|
|
||||||
|
|
||||||
def test_send_user_confirm_new_email_returns_204(client, sample_user, change_email_confirmation_template, mocker):
|
def test_send_user_confirm_new_email_returns_204(client, sample_user, change_email_confirmation_template, mocker):
|
||||||
mocked = mocker.patch('app.celery.provider_tasks.deliver_email.apply_async')
|
mocked = mocker.patch('app.celery.provider_tasks.deliver_email.apply_async')
|
||||||
new_email = 'new_address@dig.gov.uk'
|
new_email = 'new_address@dig.gov.uk'
|
||||||
data = json.dumps({'email': new_email})
|
data = json.dumps({'email': new_email})
|
||||||
auth_header = create_authorization_header()
|
auth_header = create_authorization_header()
|
||||||
|
|
||||||
resp = client.post(url_for('user.send_user_confirm_new_email', user_id=str(sample_user.id)),
|
resp = client.post(url_for('user.send_user_confirm_new_email', user_id=str(sample_user.id)),
|
||||||
data=data,
|
data=data,
|
||||||
headers=[('Content-Type', 'application/json'), auth_header])
|
headers=[('Content-Type', 'application/json'), auth_header])
|
||||||
assert resp.status_code == 204
|
assert resp.status_code == 204
|
||||||
notification = Notification.query.first()
|
notification = Notification.query.first()
|
||||||
mocked.assert_called_once_with(
|
mocked.assert_called_once_with(
|
||||||
([str(notification.id)]),
|
([str(notification.id)]),
|
||||||
queue="notify")
|
queue="notify")
|
||||||
|
|
||||||
|
|
||||||
def test_send_user_confirm_new_email_returns_400_when_email_missing(client, sample_user, mocker):
|
def test_send_user_confirm_new_email_returns_400_when_email_missing(client, sample_user, mocker):
|
||||||
mocked = mocker.patch('app.celery.provider_tasks.deliver_email.apply_async')
|
mocked = mocker.patch('app.celery.provider_tasks.deliver_email.apply_async')
|
||||||
data = json.dumps({})
|
data = json.dumps({})
|
||||||
auth_header = create_authorization_header()
|
auth_header = create_authorization_header()
|
||||||
resp = client.post(url_for('user.send_user_confirm_new_email', user_id=str(sample_user.id)),
|
resp = client.post(url_for('user.send_user_confirm_new_email', user_id=str(sample_user.id)),
|
||||||
data=data,
|
data=data,
|
||||||
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': ['Missing data for required field.']}
|
assert json.loads(resp.get_data(as_text=True))['message'] == {'email': ['Missing data for required field.']}
|
||||||
mocked.assert_not_called()
|
mocked.assert_not_called()
|
||||||
|
|||||||
Reference in New Issue
Block a user