Updates after code review.

- Remove print
- Update exception message.
This commit is contained in:
Rebecca Law
2018-03-19 14:08:38 +00:00
parent 0dc50190b2
commit cd2d85f2a3
2 changed files with 3 additions and 3 deletions

View File

@@ -33,7 +33,7 @@ def deliver_sms(self, notification_id):
)
self.retry(queue=QueueNames.RETRY)
except self.MaxRetriesExceededError:
message = "RETRY FAILED: task send_sms_to_provider failed for notification {}. " \
message = "RETRY FAILED: Max retries reached. The task send_sms_to_provider failed for notification {}. " \
"Notification has been updated to technical-failure".format(notification_id)
update_notification_status_by_id(notification_id, NOTIFICATION_TECHNICAL_FAILURE)
raise NotificationTechnicalFailureException(message)
@@ -57,7 +57,8 @@ def deliver_email(self, notification_id):
)
self.retry(queue=QueueNames.RETRY)
except self.MaxRetriesExceededError:
message = "RETRY FAILED: task send_email_to_provider failed for notification {}. " \
message = "RETRY FAILED: Max retries reached. " \
"The task send_email_to_provider failed for notification {}. " \
"Notification has been updated to technical-failure".format(notification_id)
update_notification_status_by_id(notification_id, NOTIFICATION_TECHNICAL_FAILURE)
raise NotificationTechnicalFailureException(message)

View File

@@ -184,7 +184,6 @@ def test_update_status_of_notifications_after_timeout(notify_api, sample_templat
seconds=current_app.config.get('SENDING_NOTIFICATIONS_TIMEOUT_PERIOD') + 10))
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'