Changed the timeout notications update query to set notifications still in created to a technical-failure and notifications still in sending or pending are set to a temporary-failure

This commit is contained in:
Rebecca Law
2016-12-16 11:40:58 +00:00
parent a6da1ac864
commit 40dca7f9c7
3 changed files with 45 additions and 11 deletions

View File

@@ -66,8 +66,26 @@ def test_update_status_of_notifications_after_timeout(notify_api,
status='sending',
created_at=datetime.utcnow() - timedelta(
seconds=current_app.config.get('SENDING_NOTIFICATIONS_TIMEOUT_PERIOD') + 10))
not2 = sample_notification(
notify_db,
notify_db_session,
service=sample_service,
template=sample_template,
status='created',
created_at=datetime.utcnow() - timedelta(
seconds=current_app.config.get('SENDING_NOTIFICATIONS_TIMEOUT_PERIOD') + 10))
not3 = sample_notification(
notify_db,
notify_db_session,
service=sample_service,
template=sample_template,
status='pending',
created_at=datetime.utcnow() - timedelta(
seconds=current_app.config.get('SENDING_NOTIFICATIONS_TIMEOUT_PERIOD') + 10))
timeout_notifications()
assert not1.status == 'technical-failure'
assert not1.status == 'temporary-failure'
assert not2.status == 'technical-failure'
assert not3.status == 'temporary-failure'
def test_not_update_status_of_notification_before_timeout(notify_api,