From 9e6c2bf3e0f8ee8e5b2d6925cf6da01ba1b5060e Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Wed, 21 Jul 2021 20:21:12 +1000 Subject: [PATCH] Strengthen the notification tests --- backend/tests/test_notification.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/tests/test_notification.py b/backend/tests/test_notification.py index 2c39ed91..e07d77ef 100644 --- a/backend/tests/test_notification.py +++ b/backend/tests/test_notification.py @@ -52,11 +52,14 @@ def test_check_notification(client, live_server): # Because we hit 'send test notification on save' time.sleep(3) + notification_submission = None + # Verify what was sent as a notification, this file should exist with open("test-datastore/notification.txt", "r") as f: notification_submission = f.read() # Did we see the URL that had a change, in the notification? - assert test_url in notification_submission + + assert test_url in notification_submission os.unlink("test-datastore/notification.txt") @@ -75,11 +78,13 @@ def test_check_notification(client, live_server): assert bytes("just now".encode('utf-8')) in res.data + notification_submission=None # Verify what was sent as a notification with open("test-datastore/notification.txt", "r") as f: notification_submission = f.read() # Did we see the URL that had a change, in the notification? - assert test_url in notification_submission + + assert test_url in notification_submission # Re #65 - did we see our foobar.com BASE_URL ? #assert bytes("https://foobar.com".encode('utf-8')) in notification_submission