From 8103634e9d50c04ef412d5131bc103e469ff2fdd Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Mon, 5 Dec 2022 17:58:48 +0100 Subject: [PATCH] extend test --- changedetectionio/tests/test_notification.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/changedetectionio/tests/test_notification.py b/changedetectionio/tests/test_notification.py index aae88768..6302ff70 100644 --- a/changedetectionio/tests/test_notification.py +++ b/changedetectionio/tests/test_notification.py @@ -335,11 +335,20 @@ def test_notification_jinaj2(client, live_server): client.get(url_for("form_watch_checknow"), follow_redirects=True) time.sleep(3) - + # URL check assert os.path.isfile("test-datastore/notification-url.txt") - with open("test-datastore/notification-url.txt", 'r') as f: notification = f.read() assert 'XXX=http' in notification - os.unlink("test-datastore/notification-url.txt") \ No newline at end of file + os.unlink("test-datastore/notification-url.txt") + + # BODY and TITLE check + assert os.path.isfile("test-datastore/notification.txt") + with open("test-datastore/notification.txt", 'r') as f: + notification = json.loads(f.read()) + assert notification + + assert 'New ChangeDetection.io Notification - http://localhost' in notification['title'] + assert 'Got http://localhost' in notification['message'] +