Update NotificationTechnicalFailureException

- Change the NotificationTechnicalFailureException so that it only inherits from Exception.
- The notify_celery task should create the logging message on failure.
- Fix unit tests
- Remove named parameter when raising exception.
This commit is contained in:
Rebecca Law
2019-08-12 16:51:39 +01:00
parent 9d8e8747d1
commit ae1bc54f9e
6 changed files with 9 additions and 12 deletions

View File

@@ -139,9 +139,9 @@ def test_should_not_send_email_message_when_service_is_inactive_notifcation_is_i
with pytest.raises(NotificationTechnicalFailureException) as e:
send_to_providers.send_email_to_provider(sample_notification)
assert sample_notification.id in e.value
send_mock.assert_not_called()
assert Notification.query.get(sample_notification.id).status == 'technical-failure'
assert str(sample_notification.id) in e.value.message
@pytest.mark.parametrize("client_send", ["app.mmg_client.send_sms", "app.firetext_client.send_sms"])
@@ -152,9 +152,9 @@ def test_should_not_send_sms_message_when_service_is_inactive_notifcation_is_in_
with pytest.raises(NotificationTechnicalFailureException) as e:
send_to_providers.send_sms_to_provider(sample_notification)
assert sample_notification.id in e.value
send_mock.assert_not_called()
assert Notification.query.get(sample_notification.id).status == 'technical-failure'
assert str(sample_notification.id) in e.value.message
def test_send_sms_should_use_template_version_from_notification_not_latest(