mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 02:11:11 -05:00
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user