From cac53a76c039515f985b9f6396e56a8c10789c46 Mon Sep 17 00:00:00 2001 From: bwees Date: Sat, 16 Jul 2022 19:13:20 -0400 Subject: [PATCH] added antoher step to test to cover case as described https://github.com/dgtlmoon/changedetection.io/pull/749#issuecomment-1186209681 --- .../tests/test_diff_filter_only_additions.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/changedetectionio/tests/test_diff_filter_only_additions.py b/changedetectionio/tests/test_diff_filter_only_additions.py index 3b3d48c4..6d0e6907 100644 --- a/changedetectionio/tests/test_diff_filter_only_additions.py +++ b/changedetectionio/tests/test_diff_filter_only_additions.py @@ -64,9 +64,19 @@ def test_diff_filtering_no_add(client, live_server): # We should NOT see the change res = client.get(url_for("index")) - # save res.data to a file - with open("./test-index.html", "w") as f: - f.write(res.data.decode("utf-8")) - assert b'unviewed' not in res.data + # Make an delete change + set_original_response() + + time.sleep(sleep_time_for_fetch_thread) + # Trigger a check + client.get(url_for("form_watch_checknow"), follow_redirects=True) + + # Give the thread time to pick it up + time.sleep(sleep_time_for_fetch_thread) + + # We should see the change + res = client.get(url_for("index")) + assert b'unviewed' in res.data +