Ad a reference to the model

- used if 3rd party needs to record an ID for reconciliation purposes
This commit is contained in:
Martyn Inglis
2016-03-11 09:40:35 +00:00
parent 8d9b5b172b
commit 901d04605f
6 changed files with 94 additions and 10 deletions

View File

@@ -18,12 +18,20 @@ from app.dao.notifications_dao import (
delete_failed_notifications_created_more_than_a_week_ago,
dao_get_notification_statistics_for_service_and_day,
update_notification_status_by_id,
update_notification_status_by_to
update_notification_status_by_to,
update_notification_reference_by_id
)
from tests.app.conftest import sample_job
from tests.app.conftest import sample_notification
def test_should_by_able_to_update_reference_by_id(sample_notification):
assert not Notification.query.get(sample_notification.id).reference
count = update_notification_reference_by_id(sample_notification.id, 'reference')
assert count == 1
assert Notification.query.get(sample_notification.id).reference == 'reference'
def test_should_by_able_to_update_status_by_id(sample_notification):
assert Notification.query.get(sample_notification.id).status == 'sent'
count = update_notification_status_by_id(sample_notification.id, 'delivered')