Ensure the relationship between Notification and ScheduledNotification is one-to-one.

Update db script with the right number
This commit is contained in:
Rebecca Law
2017-05-16 15:29:31 +01:00
parent 2e078f9fc8
commit 1034762489
3 changed files with 15 additions and 12 deletions

View File

@@ -716,13 +716,18 @@ def test_save_notification_with_no_job(sample_template, mmg_provider):
assert notification_from_db.status == 'created'
def test_get_notification_by_id(sample_notification):
def test_get_notification_by_id(notify_db, notify_db_session, client, sample_template):
notification = sample_notification(notify_db=notify_db, notify_db_session=notify_db_session,
template=sample_template,
scheduled_for='2017-05-05 14:00:00',
status='created')
notification_from_db = get_notification_with_personalisation(
sample_notification.service.id,
sample_notification.id,
sample_template.service.id,
notification.id,
key_type=None
)
assert sample_notification == notification_from_db
assert notification == notification_from_db
assert notification_from_db.scheduled_notification.scheduled_for == datetime(2017, 5, 5, 14, 0)
def test_get_notifications_by_reference(notify_db, notify_db_session, sample_service):