From 8688f9ecaa8db561e3ae5a7bfbbc1040d2e2c61c Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Tue, 16 Sep 2025 17:56:18 +0200 Subject: [PATCH] more --- .../tests/custom_browser_url/test_custom_browser_url.py | 3 ++- .../tests/fetchers/test_custom_js_before_content.py | 1 + changedetectionio/tests/proxy_list/test_noproxy.py | 1 + .../tests/proxy_socks5/test_socks5_proxy.py | 1 + .../tests/proxy_socks5/test_socks5_proxy_sources.py | 1 + changedetectionio/tests/test_conditions.py | 4 +++- changedetectionio/tests/test_element_removal.py | 2 ++ changedetectionio/tests/test_errorhandling.py | 3 ++- changedetectionio/tests/test_extract_regex.py | 9 ++++++--- .../tests/test_filter_failure_notification.py | 1 + changedetectionio/tests/test_ignore_text.py | 4 ++-- changedetectionio/tests/test_ignorestatuscode.py | 2 +- changedetectionio/tests/test_jsonpath_jq_selector.py | 9 ++++++--- changedetectionio/tests/test_live_preview.py | 1 + changedetectionio/tests/test_notification.py | 6 ++++-- changedetectionio/tests/test_notification_errors.py | 3 ++- changedetectionio/tests/test_restock_itemprop.py | 5 +++-- changedetectionio/tests/test_rss.py | 1 + changedetectionio/tests/test_scheduler.py | 3 ++- changedetectionio/tests/test_search.py | 4 ++-- changedetectionio/tests/test_security.py | 6 ++++-- changedetectionio/tests/test_source.py | 2 +- changedetectionio/tests/test_trigger.py | 3 ++- changedetectionio/tests/test_trigger_regex.py | 3 ++- .../tests/test_trigger_regex_with_filter.py | 3 ++- .../tests/visualselector/test_fetch_data.py | 5 ++++- 26 files changed, 59 insertions(+), 27 deletions(-) diff --git a/changedetectionio/tests/custom_browser_url/test_custom_browser_url.py b/changedetectionio/tests/custom_browser_url/test_custom_browser_url.py index 6ec4205ee..5590ba989 100644 --- a/changedetectionio/tests/custom_browser_url/test_custom_browser_url.py +++ b/changedetectionio/tests/custom_browser_url/test_custom_browser_url.py @@ -55,7 +55,8 @@ def do_test(client, live_server, make_test_use_extra_browser=False): "tags": "", "headers": "", 'fetch_backend': f"extra_browser_{custom_browser_name}", - 'webdriver_js_execute_code': '' + 'webdriver_js_execute_code': '', + "time_between_check_use_default": "y" }, follow_redirects=True ) diff --git a/changedetectionio/tests/fetchers/test_custom_js_before_content.py b/changedetectionio/tests/fetchers/test_custom_js_before_content.py index cb4d6286c..ec41759ff 100644 --- a/changedetectionio/tests/fetchers/test_custom_js_before_content.py +++ b/changedetectionio/tests/fetchers/test_custom_js_before_content.py @@ -28,6 +28,7 @@ def test_execute_custom_js(client, live_server, measure_memory_usage): 'fetch_backend': "html_webdriver", 'webdriver_js_execute_code': 'document.querySelector("button[name=test-button]").click();', 'headers': "testheader: yes\buser-agent: MyCustomAgent", + "time_between_check_use_default": "y", }, follow_redirects=True ) diff --git a/changedetectionio/tests/proxy_list/test_noproxy.py b/changedetectionio/tests/proxy_list/test_noproxy.py index fdd9aa354..bbdd75dca 100644 --- a/changedetectionio/tests/proxy_list/test_noproxy.py +++ b/changedetectionio/tests/proxy_list/test_noproxy.py @@ -62,6 +62,7 @@ def test_noproxy_option(client, live_server, measure_memory_usage): "proxy": "no-proxy", "tags": "", "url": url, + "time_between_check_use_default": "y", }, follow_redirects=True ) diff --git a/changedetectionio/tests/proxy_socks5/test_socks5_proxy.py b/changedetectionio/tests/proxy_socks5/test_socks5_proxy.py index f2595bd01..96c302c4e 100644 --- a/changedetectionio/tests/proxy_socks5/test_socks5_proxy.py +++ b/changedetectionio/tests/proxy_socks5/test_socks5_proxy.py @@ -66,6 +66,7 @@ def test_socks5(client, live_server, measure_memory_usage): "proxy": "ui-0socks5proxy", "tags": "", "url": test_url, + "time_between_check_use_default": "y", }, follow_redirects=True ) diff --git a/changedetectionio/tests/proxy_socks5/test_socks5_proxy_sources.py b/changedetectionio/tests/proxy_socks5/test_socks5_proxy_sources.py index 3805c88d1..0893da42b 100644 --- a/changedetectionio/tests/proxy_socks5/test_socks5_proxy_sources.py +++ b/changedetectionio/tests/proxy_socks5/test_socks5_proxy_sources.py @@ -53,6 +53,7 @@ def test_socks5_from_proxiesjson_file(client, live_server, measure_memory_usage) "proxy": "socks5proxy", "tags": "", "url": test_url, + "time_between_check_use_default": "y", }, follow_redirects=True ) diff --git a/changedetectionio/tests/test_conditions.py b/changedetectionio/tests/test_conditions.py index e83dc0c8e..e06f80448 100644 --- a/changedetectionio/tests/test_conditions.py +++ b/changedetectionio/tests/test_conditions.py @@ -105,6 +105,7 @@ def test_conditions_with_text_and_number(client, live_server): "conditions-5-operator": "contains_regex", "conditions-5-field": "page_filtered_text", "conditions-5-value": "\d", + "time_between_check_use_default": "y", }, follow_redirects=True ) @@ -288,7 +289,8 @@ def test_lev_conditions_plugin(client, live_server, measure_memory_usage): "conditions_match_logic": CONDITIONS_MATCH_LOGIC_DEFAULT, # ALL = AND logic "conditions-0-field": "levenshtein_ratio", "conditions-0-operator": "<", - "conditions-0-value": "0.8" # needs to be more of a diff to trigger a change + "conditions-0-value": "0.8", # needs to be more of a diff to trigger a change + "time_between_check_use_default": "y" }, follow_redirects=True ) diff --git a/changedetectionio/tests/test_element_removal.py b/changedetectionio/tests/test_element_removal.py index 36643b713..9ce1d0fa7 100644 --- a/changedetectionio/tests/test_element_removal.py +++ b/changedetectionio/tests/test_element_removal.py @@ -171,6 +171,7 @@ def test_element_removal_full(client, live_server, measure_memory_usage): "tags": "", "headers": "", "fetch_backend": "html_requests", + "time_between_check_use_default": "y", }, follow_redirects=True, ) @@ -245,6 +246,7 @@ body > table > tr:nth-child(3) > td:nth-child(3)""", "url": test_url, "tags": "", "fetch_backend": "html_requests", + "time_between_check_use_default": "y", }, follow_redirects=True, ) diff --git a/changedetectionio/tests/test_errorhandling.py b/changedetectionio/tests/test_errorhandling.py index 27b9a3188..f79c4dda8 100644 --- a/changedetectionio/tests/test_errorhandling.py +++ b/changedetectionio/tests/test_errorhandling.py @@ -127,7 +127,8 @@ def test_low_level_errors_clear_correctly(client, live_server, measure_memory_us url_for("ui.ui_edit.edit_page", uuid="first"), data={ "url": test_url, - "fetch_backend": "html_requests"}, + "fetch_backend": "html_requests", + "time_between_check_use_default": "y"}, follow_redirects=True ) diff --git a/changedetectionio/tests/test_extract_regex.py b/changedetectionio/tests/test_extract_regex.py index 3b270d3fa..82ef12c4c 100644 --- a/changedetectionio/tests/test_extract_regex.py +++ b/changedetectionio/tests/test_extract_regex.py @@ -95,7 +95,8 @@ def test_check_filter_multiline(client, live_server, measure_memory_usage): "url": test_url, "tags": "", "headers": "", - 'fetch_backend': "html_requests" + 'fetch_backend': "html_requests", + "time_between_check_use_default": "y" }, follow_redirects=True ) @@ -149,7 +150,8 @@ def test_check_filter_and_regex_extract(client, live_server, measure_memory_usag "url": test_url, "tags": "", "headers": "", - 'fetch_backend': "html_requests" + 'fetch_backend': "html_requests", + "time_between_check_use_default": "y" }, follow_redirects=True ) @@ -222,7 +224,8 @@ def test_regex_error_handling(client, live_server, measure_memory_usage): url_for("ui.ui_edit.edit_page", uuid="first"), data={"extract_text": '/something bad\d{3/XYZ', "url": test_url, - "fetch_backend": "html_requests"}, + "fetch_backend": "html_requests", + "time_between_check_use_default": "y"}, follow_redirects=True ) diff --git a/changedetectionio/tests/test_filter_failure_notification.py b/changedetectionio/tests/test_filter_failure_notification.py index 7023fb55a..17311ba57 100644 --- a/changedetectionio/tests/test_filter_failure_notification.py +++ b/changedetectionio/tests/test_filter_failure_notification.py @@ -72,6 +72,7 @@ def run_filter_test(client, live_server, content_filter): "notification_format": "Text", "fetch_backend": "html_requests", "filter_failure_notification_send": 'y', + "time_between_check_use_default": "", "headers": "", "tags": "my tag", "title": "my title 123", diff --git a/changedetectionio/tests/test_ignore_text.py b/changedetectionio/tests/test_ignore_text.py index 19fe23030..1755e295a 100644 --- a/changedetectionio/tests/test_ignore_text.py +++ b/changedetectionio/tests/test_ignore_text.py @@ -111,7 +111,7 @@ def test_check_ignore_text_functionality(client, live_server, measure_memory_usa # Add our URL to the import page res = client.post( url_for("ui.ui_edit.edit_page", uuid="first"), - data={"ignore_text": ignore_text, "url": test_url, 'fetch_backend': "html_requests"}, + data={"ignore_text": ignore_text, "url": test_url, 'fetch_backend': "html_requests", "time_between_check_use_default": "y"}, follow_redirects=True ) assert b"Updated watch." in res.data @@ -205,7 +205,7 @@ def _run_test_global_ignore(client, as_source=False, extra_ignore=""): #Adding some ignore text should not trigger a change res = client.post( url_for("ui.ui_edit.edit_page", uuid="first"), - data={"ignore_text": "something irrelevent but just to check", "url": test_url, 'fetch_backend': "html_requests"}, + data={"ignore_text": "something irrelevent but just to check", "url": test_url, 'fetch_backend': "html_requests", "time_between_check_use_default": "y"}, follow_redirects=True ) assert b"Updated watch." in res.data diff --git a/changedetectionio/tests/test_ignorestatuscode.py b/changedetectionio/tests/test_ignorestatuscode.py index a28e8996a..45bf9616c 100644 --- a/changedetectionio/tests/test_ignorestatuscode.py +++ b/changedetectionio/tests/test_ignorestatuscode.py @@ -108,7 +108,7 @@ def test_403_page_check_works_with_ignore_status_code(client, live_server, measu # Add our URL to the import page res = client.post( url_for("ui.ui_edit.edit_page", uuid="first"), - data={"ignore_status_codes": "y", "url": test_url, "tags": "", "headers": "", 'fetch_backend': "html_requests"}, + data={"ignore_status_codes": "y", "url": test_url, "tags": "", "headers": "", 'fetch_backend': "html_requests", "time_between_check_use_default": "y"}, follow_redirects=True ) assert b"Updated watch." in res.data diff --git a/changedetectionio/tests/test_jsonpath_jq_selector.py b/changedetectionio/tests/test_jsonpath_jq_selector.py index 095fde32b..b33da74d2 100644 --- a/changedetectionio/tests/test_jsonpath_jq_selector.py +++ b/changedetectionio/tests/test_jsonpath_jq_selector.py @@ -257,7 +257,8 @@ def check_json_filter(json_filter, client, live_server): "url": test_url, "tags": "", "headers": "", - "fetch_backend": "html_requests" + "fetch_backend": "html_requests", + "time_between_check_use_default": "y" }, follow_redirects=True ) @@ -328,7 +329,8 @@ def check_json_filter_bool_val(json_filter, client, live_server): "url": test_url, "tags": "", "headers": "", - "fetch_backend": "html_requests" + "fetch_backend": "html_requests", + "time_between_check_use_default": "y" }, follow_redirects=True ) @@ -393,7 +395,8 @@ def check_json_ext_filter(json_filter, client, live_server): "url": test_url, "tags": "", "headers": "", - "fetch_backend": "html_requests" + "fetch_backend": "html_requests", + "time_between_check_use_default": "y" }, follow_redirects=True ) diff --git a/changedetectionio/tests/test_live_preview.py b/changedetectionio/tests/test_live_preview.py index 088e695f2..c811f71ff 100644 --- a/changedetectionio/tests/test_live_preview.py +++ b/changedetectionio/tests/test_live_preview.py @@ -38,6 +38,7 @@ def test_content_filter_live_preview(client, live_server, measure_memory_usage): "ignore_text": "something to ignore", "trigger_text": "something to trigger", "url": test_url, + "time_between_check_use_default": "y", }, follow_redirects=True ) diff --git a/changedetectionio/tests/test_notification.py b/changedetectionio/tests/test_notification.py index 8640d2cca..c7ac1bdf1 100644 --- a/changedetectionio/tests/test_notification.py +++ b/changedetectionio/tests/test_notification.py @@ -108,7 +108,8 @@ def test_check_notification(client, live_server, measure_memory_usage): "tags": "my tag, my second tag", "title": "my title", "headers": "", - "fetch_backend": "html_requests"}) + "fetch_backend": "html_requests", + "time_between_check_use_default": "y"}) res = client.post( url_for("ui.ui_edit.edit_page", uuid="first"), @@ -225,7 +226,8 @@ def test_check_notification(client, live_server, measure_memory_usage): "notification_title": '', "notification_body": '', "notification_format": default_notification_format, - "fetch_backend": "html_requests"}, + "fetch_backend": "html_requests", + "time_between_check_use_default": "y"}, follow_redirects=True ) assert b"Updated watch." in res.data diff --git a/changedetectionio/tests/test_notification_errors.py b/changedetectionio/tests/test_notification_errors.py index 9b4ac7706..0d2c530cc 100644 --- a/changedetectionio/tests/test_notification_errors.py +++ b/changedetectionio/tests/test_notification_errors.py @@ -36,7 +36,8 @@ def test_check_notification_error_handling(client, live_server, measure_memory_u "title": "", "headers": "", "time_between_check-minutes": "180", - "fetch_backend": "html_requests"}, + "fetch_backend": "html_requests", + "time_between_check_use_default": "y"}, follow_redirects=True ) assert b"Updated watch." in res.data diff --git a/changedetectionio/tests/test_restock_itemprop.py b/changedetectionio/tests/test_restock_itemprop.py index 0627f5973..5c7919fe7 100644 --- a/changedetectionio/tests/test_restock_itemprop.py +++ b/changedetectionio/tests/test_restock_itemprop.py @@ -121,7 +121,7 @@ def test_itemprop_price_change(client, live_server): set_original_response(props_markup=instock_props[0], price='120.45') res = client.post( url_for("ui.ui_edit.edit_page", uuid="first"), - data={"restock_settings-follow_price_changes": "", "url": test_url, "tags": "", "headers": "", 'fetch_backend': "html_requests"}, + data={"restock_settings-follow_price_changes": "", "url": test_url, "tags": "", "headers": "", 'fetch_backend': "html_requests", "time_between_check_use_default": "y"}, follow_redirects=True ) assert b"Updated watch." in res.data @@ -278,7 +278,8 @@ def test_itemprop_percent_threshold(client, live_server): "url": test_url, "tags": "", "headers": "", - 'fetch_backend': "html_requests" + 'fetch_backend': "html_requests", + "time_between_check_use_default": "y" }, follow_redirects=True ) diff --git a/changedetectionio/tests/test_rss.py b/changedetectionio/tests/test_rss.py index 847c9fade..a3e13c02f 100644 --- a/changedetectionio/tests/test_rss.py +++ b/changedetectionio/tests/test_rss.py @@ -158,6 +158,7 @@ def test_rss_xpath_filtering(client, live_server, measure_memory_usage): "proxy": "no-proxy", "tags": "", "url": test_url, + "time_between_check_use_default": "y", }, follow_redirects=True ) diff --git a/changedetectionio/tests/test_scheduler.py b/changedetectionio/tests/test_scheduler.py index 772dc0b30..6ec54f52a 100644 --- a/changedetectionio/tests/test_scheduler.py +++ b/changedetectionio/tests/test_scheduler.py @@ -63,7 +63,8 @@ def test_check_basic_scheduler_functionality(client, live_server, measure_memory last_check = live_server.app.config['DATASTORE'].data['watching'][uuid]['last_checked'] data = { "url": test_url, - "fetch_backend": "html_requests" + "fetch_backend": "html_requests", + "time_between_check_use_default": "y" } data.update(scheduler_data) diff --git a/changedetectionio/tests/test_search.py b/changedetectionio/tests/test_search.py index eb6f0ee9f..580d8b9ae 100644 --- a/changedetectionio/tests/test_search.py +++ b/changedetectionio/tests/test_search.py @@ -27,7 +27,7 @@ def test_basic_search(client, live_server, measure_memory_usage): res = client.post( url_for("ui.ui_edit.edit_page", uuid="first"), - data={"title": "xxx-title", "url": urls[0], "tags": "", "headers": "", 'fetch_backend': "html_requests"}, + data={"title": "xxx-title", "url": urls[0], "tags": "", "headers": "", 'fetch_backend': "html_requests", "time_between_check_use_default": "y"}, follow_redirects=True ) assert b"Updated watch." in res.data @@ -62,7 +62,7 @@ def test_search_in_tag_limit(client, live_server, measure_memory_usage): res = client.post( url_for("ui.ui_edit.edit_page", uuid="first"), data={"title": "xxx-title", "url": urls[0].split(' ')[0], "tags": urls[0].split(' ')[1], "headers": "", - 'fetch_backend': "html_requests"}, + 'fetch_backend': "html_requests", "time_between_check_use_default": "y"}, follow_redirects=True ) assert b"Updated watch." in res.data diff --git a/changedetectionio/tests/test_security.py b/changedetectionio/tests/test_security.py index 0cb429e58..01c4374a0 100644 --- a/changedetectionio/tests/test_security.py +++ b/changedetectionio/tests/test_security.py @@ -41,7 +41,8 @@ def test_bad_access(client, live_server, measure_memory_usage): "tags": "", "method": "GET", "fetch_backend": "html_requests", - "body": ""}, + "body": "", + "time_between_check_use_default": "y"}, follow_redirects=True ) @@ -150,7 +151,8 @@ def test_xss_watch_last_error(client, live_server, measure_memory_usage): data={ "include_filters": '', "url": url_for('test_endpoint', _external=True), - 'fetch_backend': "html_requests" + 'fetch_backend': "html_requests", + "time_between_check_use_default": "y" }, follow_redirects=True ) diff --git a/changedetectionio/tests/test_source.py b/changedetectionio/tests/test_source.py index 992314c1f..bea310b48 100644 --- a/changedetectionio/tests/test_source.py +++ b/changedetectionio/tests/test_source.py @@ -77,7 +77,7 @@ def test_check_ignore_elements(client, live_server, measure_memory_usage): client.post( url_for("ui.ui_edit.edit_page", uuid="first"), - data={"include_filters": 'span,p', "url": test_url, "tags": "", "subtractive_selectors": ".foobar-detection", 'fetch_backend': "html_requests"}, + data={"include_filters": 'span,p', "url": test_url, "tags": "", "subtractive_selectors": ".foobar-detection", 'fetch_backend': "html_requests", "time_between_check_use_default": "y"}, follow_redirects=True ) diff --git a/changedetectionio/tests/test_trigger.py b/changedetectionio/tests/test_trigger.py index 0df5ec3b5..6bccf812e 100644 --- a/changedetectionio/tests/test_trigger.py +++ b/changedetectionio/tests/test_trigger.py @@ -81,7 +81,8 @@ def test_trigger_functionality(client, live_server, measure_memory_usage): url_for("ui.ui_edit.edit_page", uuid="first"), data={"trigger_text": trigger_text, "url": test_url, - "fetch_backend": "html_requests"}, + "fetch_backend": "html_requests", + "time_between_check_use_default": "y"}, follow_redirects=True ) assert b"Updated watch." in res.data diff --git a/changedetectionio/tests/test_trigger_regex.py b/changedetectionio/tests/test_trigger_regex.py index 25253f216..987ef0630 100644 --- a/changedetectionio/tests/test_trigger_regex.py +++ b/changedetectionio/tests/test_trigger_regex.py @@ -49,7 +49,8 @@ def test_trigger_regex_functionality(client, live_server, measure_memory_usage): url_for("ui.ui_edit.edit_page", uuid="first"), data={"trigger_text": '/something \d{3}/', "url": test_url, - "fetch_backend": "html_requests"}, + "fetch_backend": "html_requests", + "time_between_check_use_default": "y"}, follow_redirects=True ) wait_for_all_checks(client) diff --git a/changedetectionio/tests/test_trigger_regex_with_filter.py b/changedetectionio/tests/test_trigger_regex_with_filter.py index a78b8fc46..b68165261 100644 --- a/changedetectionio/tests/test_trigger_regex_with_filter.py +++ b/changedetectionio/tests/test_trigger_regex_with_filter.py @@ -50,7 +50,8 @@ def test_trigger_regex_functionality_with_filter(client, live_server, measure_me data={"trigger_text": "/cool.stuff/", "url": test_url, "include_filters": '#in-here', - "fetch_backend": "html_requests"}, + "fetch_backend": "html_requests", + "time_between_check_use_default": "y"}, follow_redirects=True ) diff --git a/changedetectionio/tests/visualselector/test_fetch_data.py b/changedetectionio/tests/visualselector/test_fetch_data.py index c476f7db2..f0249ecad 100644 --- a/changedetectionio/tests/visualselector/test_fetch_data.py +++ b/changedetectionio/tests/visualselector/test_fetch_data.py @@ -36,6 +36,7 @@ def test_visual_selector_content_ready(client, live_server, measure_memory_usage # For now, cookies doesnt work in headers because it must be a full cookiejar object 'headers': "testheader: yes\buser-agent: MyCustomAgent", 'fetch_backend': "html_webdriver", + "time_between_check_use_default": "y", }, follow_redirects=True ) @@ -116,6 +117,7 @@ def test_basic_browserstep(client, live_server, measure_memory_usage): 'browser_steps-1-optional_value': '', # For now, cookies doesnt work in headers because it must be a full cookiejar object 'headers': "testheader: yes\buser-agent: MyCustomAgent", + "time_between_check_use_default": "y", }, follow_redirects=True ) @@ -167,7 +169,8 @@ def test_non_200_errors_report_browsersteps(client, live_server): 'fetch_backend': "html_webdriver", 'browser_steps-0-operation': 'Click element', 'browser_steps-0-selector': 'button[name=test-button]', - 'browser_steps-0-optional_value': '' + 'browser_steps-0-optional_value': '', + "time_between_check_use_default": "y" }, follow_redirects=True )