From d745df3f44b4ef1c65633a9188453096ab255f64 Mon Sep 17 00:00:00 2001 From: Imdad Ahad Date: Mon, 22 May 2017 15:10:05 +0100 Subject: [PATCH] Fix test that doesn't account for notifications being created in a different order --- tests/app/service/test_sender.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/app/service/test_sender.py b/tests/app/service/test_sender.py index cb6ee93fd..ca042cc67 100644 --- a/tests/app/service/test_sender.py +++ b/tests/app/service/test_sender.py @@ -106,7 +106,9 @@ def test_send_notification_to_service_users_sends_to_active_users_only( send_notification_to_service_users(service_id=service.id, template_id=template.id) notifications = Notification.query.all() + notifications_recipients = [notification.to for notification in notifications] assert Notification.query.count() == 2 - - assert pending_user.email_address not in [n.to for n in notifications] + assert pending_user.email_address not in notifications_recipients + assert first_active_user.email_address in notifications_recipients + assert second_active_user.email_address in notifications_recipients