From 16882961ad517d45c27349357ea4b2e3bb343741 Mon Sep 17 00:00:00 2001 From: Nicholas Staples Date: Tue, 15 Mar 2016 14:57:15 +0000 Subject: [PATCH] Added check for job in notifications json dump. --- tests/app/notifications/test_rest.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/app/notifications/test_rest.py b/tests/app/notifications/test_rest.py index 3abe3fc97..da5cc1dc7 100644 --- a/tests/app/notifications/test_rest.py +++ b/tests/app/notifications/test_rest.py @@ -28,6 +28,10 @@ def test_get_notification_by_id(notify_api, sample_notification): assert notification['template'] == { 'id': sample_notification.template.id, 'name': sample_notification.template.name} + assert notification['job'] == { + 'id': str(sample_notification.job.id), + 'file_name': sample_notification.job.file_name + } assert notification['to'] == '+447700900855' assert notification['service'] == str(sample_notification.service_id) assert response.status_code == 200 @@ -69,6 +73,10 @@ def test_get_all_notifications(notify_api, sample_notification): assert notifications['notifications'][0]['template'] == { 'id': sample_notification.template.id, 'name': sample_notification.template.name} + assert notifications['notifications'][0]['job'] == { + 'id': str(sample_notification.job.id), + 'file_name': sample_notification.job.file_name + } assert notifications['notifications'][0]['to'] == '+447700900855' assert notifications['notifications'][0]['service'] == str(sample_notification.service_id) assert response.status_code == 200