If the service is inactive at the time of sending the notification to the provider, the notification is marked as technical-failure.

Removed the /service/<id>/deactivate endpoint, now using /service/<id>/archive
This commit is contained in:
Rebecca Law
2017-01-31 14:28:25 +00:00
parent fde3216f9e
commit dab89969cc
4 changed files with 11 additions and 143 deletions

View File

@@ -121,13 +121,14 @@ def test_should_send_personalised_template_to_correct_email_provider_and_persist
["app.aws_ses_client.send_email",
"app.mmg_client.send_sms",
"app.firetext_client.send_sms"])
def test_should_not_send_message_when_service_is_inactive(sample_service, sample_notification, mocker,
client_send):
def test_should_not_send_message_when_service_is_inactive_notiifcation_is_in_tech_failure(
sample_service, sample_notification, mocker, client_send):
sample_service.active = False
send_to_providers.send_email_to_provider(sample_notification)
send_mock = mocker.patch(client_send, return_value='reference')
send_to_providers.send_email_to_provider(sample_notification)
send_mock.assert_not_called()
assert Notification.query.get(sample_notification.id).status == 'technical-failure'
def test_send_sms_should_use_template_version_from_notification_not_latest(