Throw an exception whenever we updated a notification to technical failure.

If this is happening we want to know about it.
This commit is contained in:
Rebecca Law
2018-03-16 17:18:44 +00:00
parent c9477a7400
commit 0dc50190b2
11 changed files with 65 additions and 30 deletions

View File

@@ -44,6 +44,7 @@ from app.dao.provider_details_dao import (
dao_update_provider_details,
get_current_provider
)
from app.exceptions import NotificationTechnicalFailureException
from app.models import (
MonthlyBilling,
NotificationHistory,
@@ -181,8 +182,10 @@ def test_update_status_of_notifications_after_timeout(notify_api, sample_templat
status='pending',
created_at=datetime.utcnow() - timedelta(
seconds=current_app.config.get('SENDING_NOTIFICATIONS_TIMEOUT_PERIOD') + 10))
timeout_notifications()
with pytest.raises(NotificationTechnicalFailureException) as e:
timeout_notifications()
print(e.value.message)
assert str(not2.id) in e.value.message
assert not1.status == 'temporary-failure'
assert not2.status == 'technical-failure'
assert not3.status == 'temporary-failure'