Notification not created in send_sms or send_email when service is in restricted mode.

This commit is contained in:
Nicholas Staples
2016-05-31 14:55:06 +01:00
parent 8710c103f7
commit 79dfc360f2
2 changed files with 8 additions and 15 deletions

View File

@@ -456,8 +456,9 @@ def test_should_not_send_sms_if_restricted_service_and_invalid_number(notify_db,
"encrypted-in-reality",
now.strftime(DATETIME_FORMAT)
)
mmg_client.send_sms.assert_not_called()
with pytest.raises(NoResultFound):
notifications_dao.get_notification(service.id, notification_id)
def test_send_sms_should_use_template_version_from_job_not_latest(sample_template, mocker):
@@ -557,6 +558,8 @@ def test_should_not_send_email_if_restricted_service_and_invalid_email_address(n
)
aws_ses_client.send_email.assert_not_called()
with pytest.raises(NoResultFound):
notifications_dao.get_notification(service.id, notification_id)
def test_should_send_template_to_correct_sms_provider_and_persist_with_job_id(sample_job, mocker):