From 08ce1e28cecc4ce18578a96b25c03901e174ba08 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Mon, 12 Jan 2026 11:38:45 +0100 Subject: [PATCH] Adding test for #3720 --- changedetectionio/blueprint/ui/notification.py | 1 + changedetectionio/tests/test_notification.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/changedetectionio/blueprint/ui/notification.py b/changedetectionio/blueprint/ui/notification.py index b7e5a446..ae89dde2 100644 --- a/changedetectionio/blueprint/ui/notification.py +++ b/changedetectionio/blueprint/ui/notification.py @@ -119,6 +119,7 @@ def construct_blueprint(datastore: ChangeDetectionStore): sent_obj = process_notification(n_object, datastore) except Exception as e: + logger.error(e) e_str = str(e) # Remove this text which is not important and floods the container e_str = e_str.replace( diff --git a/changedetectionio/tests/test_notification.py b/changedetectionio/tests/test_notification.py index ef98db12..82fa93c1 100644 --- a/changedetectionio/tests/test_notification.py +++ b/changedetectionio/tests/test_notification.py @@ -503,7 +503,7 @@ def test_single_send_test_notification_on_watch(client, live_server, measure_mem test_notification_url = url_for('test_notification_endpoint', _external=True).replace('http://', 'post://')+"?xxx={{ watch_url }}&+custom-header=123" # 1995 UTF-8 content should be encoded - test_body = 'change detection is cool 网站监测 内容更新了 - {{diff_full}}' + test_body = 'change detection is cool 网站监测 内容更新了 - {{diff_full}}\n\nCurrent snapshot: {{current_snapshot}}' ######### Test global/system settings res = client.post( url_for("ui.ui_notification.ajax_callback_send_notification_test")+f"/{uuid}", @@ -528,7 +528,8 @@ def test_single_send_test_notification_on_watch(client, live_server, measure_mem assert 'title="Changed into">Example text:' not in x assert 'span' not in x assert 'Example text:' in x - + #3720 current_snapshot check, was working but lets test it exactly. + assert 'Current snapshot: Example text: example test' in x os.unlink(os.path.join(datastore_path, "notification.txt")) def _test_color_notifications(client, notification_body_token, datastore_path):