Some minor refactoring.

- Updated notifications_dao.update_notification_status_by_id with an optional parameter to set the sent_by, this will eliminate a separate update to notifcaitons.
- Added the callback url to the log message, that way we can see if it's the same url failing.
- Stop sending the status callbacks for PENDING status.
This commit is contained in:
Rebecca Law
2018-10-24 11:24:53 +01:00
parent 08caaec0f8
commit 00f04c33c8
5 changed files with 33 additions and 14 deletions

View File

@@ -141,6 +141,14 @@ def test_should_update_status_by_id_if_created(notify_db, notify_db_session):
assert updated.status == 'failed'
def test_should_update_status_by_id_and_set_sent_by(notify_db, notify_db_session):
notification = sample_notification(notify_db, notify_db_session, status='sending')
updated = update_notification_status_by_id(notification.id, 'delivered', sent_by='mmg')
assert updated.status == 'delivered'
assert updated.sent_by == 'mmg'
def test_should_not_update_status_by_reference_if_from_country_with_no_delivery_receipts(sample_template):
notification = create_notification(
sample_template,