mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 18:01:08 -05:00
Fix assertions when we catch an error in the tests
Code that is within a `with Python.raises(...)` context manager but comes after the line that raises the exception doesn't get evaluated. We had some assertions that we never being tested because of this, so this ensures that they will always get run and fixes them where necessary.
This commit is contained in:
@@ -182,7 +182,7 @@ def test_update_letter_notifications_to_error_updates_based_on_notification_refe
|
||||
with freeze_time(dt):
|
||||
with pytest.raises(NotificationTechnicalFailureException) as e:
|
||||
update_letter_notifications_to_error([first.reference])
|
||||
assert first.reference in e.value
|
||||
assert first.reference in str(e.value)
|
||||
|
||||
assert first.status == NOTIFICATION_TECHNICAL_FAILURE
|
||||
assert first.sent_by is None
|
||||
|
||||
Reference in New Issue
Block a user