mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 14:31:57 -05:00
Validate recipient for restricted service w/ utils
Implements https://github.com/alphagov/notifications-utils/pull/16 Once https://github.com/alphagov/notifications-admin/pull/376 is merged it will no longer be possible for a user to upload a CSV file containing recipients that they’re not allowed to send to. So this commit also removes any restricted service checks in the task, because any public phone numbers/email addresses no longer have any way of reach this point if the service is restricted.
This commit is contained in:
@@ -879,7 +879,7 @@ def test_should_not_send_email_if_restricted_and_not_a_service_user(notify_api,
|
||||
app.celery.tasks.send_email.apply_async.assert_not_called()
|
||||
|
||||
assert response.status_code == 400
|
||||
assert 'Email address not permitted for restricted service' in json_resp['message']['to']
|
||||
assert 'Invalid email address for restricted service' in json_resp['message']['to']
|
||||
|
||||
|
||||
def test_should_not_send_email_for_job_if_restricted_and_not_a_service_user(
|
||||
@@ -915,7 +915,7 @@ def test_should_not_send_email_for_job_if_restricted_and_not_a_service_user(
|
||||
app.celery.tasks.send_email.apply_async.assert_not_called()
|
||||
|
||||
assert response.status_code == 400
|
||||
assert 'Email address not permitted for restricted service' in json_resp['message']['to']
|
||||
assert 'Invalid email address for restricted service' in json_resp['message']['to']
|
||||
|
||||
|
||||
@freeze_time("2016-01-01 11:09:00.061258")
|
||||
|
||||
Reference in New Issue
Block a user