test tweak

This commit is contained in:
dgtlmoon
2026-03-24 14:05:47 +01:00
parent 8cce643aab
commit fbb36d6a39
32 changed files with 47 additions and 93 deletions
+1 -1
View File
@@ -740,7 +740,6 @@ class commonSettingsForm(Form):
self.notification_title.extra_notification_tokens = kwargs.get('extra_notification_tokens', {})
self.notification_urls.extra_notification_tokens = kwargs.get('extra_notification_tokens', {})
browser_profile = RadioField(_l('Browser / Fetch method'), choices=[]) # populated at runtime in edit.py
notification_body = TextAreaField(_l('Notification Body'), default='{{ watch_url }} had a change.', validators=[validators.Optional(), ValidateJinja2Template()])
notification_format = SelectField(_l('Notification format'), choices=list(valid_notification_formats.items()))
notification_title = StringField(_l('Notification Title'), default='ChangeDetection.io Notification - {{ watch_url }}', validators=[validators.Optional(), ValidateJinja2Template()])
@@ -777,6 +776,7 @@ class SingleBrowserStep(Form):
class processor_text_json_diff_form(commonSettingsForm):
browser_profile = RadioField(_l('Browser / Fetch method'), choices=[]) # populated at runtime in edit.py
url = fields.URLField('Web Page URL', validators=[validateURL()])
tags = StringTagUUID('Group Tag', [validators.Optional()], default='')
+2
View File
@@ -37,6 +37,8 @@ class difference_detection_processor():
# 2. Preserves Watch object with properties (.link, .is_pdf, etc.) - can't use dict()
# 3. Safe now: Watch.__deepcopy__() shares datastore ref (no memory leak) but copies dict data
self.watch = deepcopy(self.datastore.data['watching'].get(watch_uuid))
if self.watch is None:
raise KeyError(f"Watch UUID {watch_uuid} not found in datastore (deleted before processing?)")
# Generic fetcher that should be extended (requests, playwright etc)
self.fetcher = Fetcher()
@@ -39,12 +39,12 @@ def do_test(client, live_server, make_test_use_extra_browser=False):
test_url = "https://changedetection.io/ci-test.html?non-custom-default=true"
# Set global default to webdriver (browser-based)
client.post(url_for("settings_browsers.set_default"), data={"machine_name": "browser_chromeplaywright", "csrf_token": ""}, follow_redirects=True)
res = client.post(
url_for("settings.settings_page"),
data={
"application-empty_pages_are_a_change": "",
"requests-time_between_check-minutes": 180,
"application-browser_profile": "browser_chromeplaywright",
},
follow_redirects=True
)
@@ -12,12 +12,12 @@ def test_fetch_webdriver_content(client, live_server, measure_memory_usage, data
# live_server_setup(live_server) # Setup on conftest per function
#####################
client.post(url_for("settings_browsers.set_default"), data={"machine_name": "browser_chromeplaywright", "csrf_token": ""}, follow_redirects=True)
res = client.post(
url_for("settings.settings_page"),
data={
"application-empty_pages_are_a_change": "",
"requests-time_between_check-minutes": 180,
'application-browser_profile': "browser_chromeplaywright",
'application-ui-favicons_enabled': "y",
},
follow_redirects=True
@@ -22,7 +22,6 @@ def test_noproxy_option(client, live_server, measure_memory_usage, datastore_pat
data={
"requests-time_between_check-minutes": 180,
"application-ignore_whitespace": "y",
"application-browser_profile": "direct_http_requests",
"requests-extra_proxies-0-proxy_name": "custom-one-proxy",
"requests-extra_proxies-0-proxy_url": "http://test:awesome@squid-one:3128",
"requests-extra_proxies-1-proxy_name": "custom-two-proxy",
@@ -21,7 +21,6 @@ def test_proxy_noconnect_custom(client, live_server, measure_memory_usage, datas
data={
"requests-time_between_check-minutes": 180,
"application-ignore_whitespace": "y",
"application-browser_profile": 'browser_chromeplaywright' if os.getenv('PLAYWRIGHT_DRIVER_URL') or os.getenv("WEBDRIVER_URL") else 'direct_http_requests',
"requests-extra_proxies-0-proxy_name": "custom-test-proxy",
# test:awesome is set in tests/proxy_list/squid-passwords.txt
"requests-extra_proxies-0-proxy_url": "http://127.0.0.1:3128",
@@ -15,7 +15,6 @@ def test_select_custom(client, live_server, measure_memory_usage, datastore_path
data={
"requests-time_between_check-minutes": 180,
"application-ignore_whitespace": "y",
"application-browser_profile": 'browser_chromeplaywright' if os.getenv('PLAYWRIGHT_DRIVER_URL') else 'direct_http_requests',
"requests-extra_proxies-0-proxy_name": "custom-test-proxy",
# test:awesome is set in tests/proxy_list/squid-passwords.txt
"requests-extra_proxies-0-proxy_url": "http://test:awesome@squid-custom:3128",
@@ -59,7 +58,6 @@ def test_custom_proxy_validation(client, live_server, measure_memory_usage, data
data={
"requests-time_between_check-minutes": 180,
"application-ignore_whitespace": "y",
"application-browser_profile": 'direct_http_requests',
"requests-extra_proxies-0-proxy_name": "custom-test-proxy",
"requests-extra_proxies-0-proxy_url": "xxxxhtt/333??p://test:awesome@squid-custom:3128",
},
@@ -75,7 +73,6 @@ def test_custom_proxy_validation(client, live_server, measure_memory_usage, data
data={
"requests-time_between_check-minutes": 180,
"application-ignore_whitespace": "y",
"application-browser_profile": 'direct_http_requests',
"requests-extra_proxies-0-proxy_name": "custom-test-proxy",
"requests-extra_proxies-0-proxy_url": "https://",
},
@@ -29,7 +29,6 @@ def test_socks5(client, live_server, measure_memory_usage, datastore_path):
data={
"requests-time_between_check-minutes": 180,
"application-ignore_whitespace": "y",
"application-browser_profile": "direct_http_requests",
# set in .github/workflows/test-only.yml
"requests-extra_proxies-0-proxy_url": "socks5://proxy_user123:proxy_pass123@socks5proxy:1080",
"requests-extra_proxies-0-proxy_name": "socks5proxy",
@@ -61,14 +61,14 @@ def test_restock_detection(client, live_server, measure_memory_usage, datastore_
#####################
# Set this up for when we remove the notification from the watch, it should fallback with these details
client.post(url_for("settings_browsers.set_default"), data={"machine_name": "browser_chromeplaywright", "csrf_token": ""}, follow_redirects=True)
res = client.post(
url_for("settings.settings_page"),
data={"application-notification_urls": notification_url,
"application-notification_title": "fallback-title "+default_notification_title,
"application-notification_body": "fallback-body "+default_notification_body,
"application-notification_format": default_notification_format,
"requests-time_between_check-minutes": 180,
'application-browser_profile': "browser_chromeplaywright"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
# Add our URL to the import page, because the docker container (playwright/selenium) wont be able to connect to our usual test url
@@ -56,8 +56,7 @@ def test_check_notification_email_formats_default_HTML(client, live_server, meas
"application-notification_title": "fallback-title " + default_notification_title,
"application-notification_body": "some text\nfallback-body<br> " + default_notification_body,
"application-notification_format": 'html',
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
assert b"Settings updated." in res.data
@@ -126,8 +125,7 @@ def test_check_notification_plaintext_format(client, live_server, measure_memory
"application-notification_title": "fallback-title {{watch_title}} {{ diff_added.splitlines()[0] if diff_added else 'diff added didnt split' }} " + default_notification_title,
"application-notification_body": f"some text\n" + default_notification_body + f"\nMore output test\n{ALL_MARKUP_TOKENS}",
"application-notification_format": 'text',
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
@@ -188,8 +186,7 @@ def test_check_notification_html_color_format(client, live_server, measure_memor
"application-notification_title": "fallback-title {{watch_title}} - diff_added_lines_test : '{{ diff_added.splitlines()[0] if diff_added else 'diff added didnt split' }}' " + default_notification_title,
"application-notification_body": f"some text\n{default_notification_body}\nMore output test\n{ALL_MARKUP_TOKENS}",
"application-notification_format": 'htmlcolor',
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
@@ -273,8 +270,7 @@ def test_check_notification_markdown_format(client, live_server, measure_memory_
"application-notification_title": "fallback-title diff_added_lines_test : '{{ diff_added.splitlines()[0] if diff_added else 'diff added didnt split' }}' " + default_notification_title,
"application-notification_body": "*header*\n\nsome text\n" + default_notification_body,
"application-notification_format": 'markdown',
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
@@ -369,8 +365,7 @@ def test_check_notification_email_formats_default_Text_override_HTML(client, liv
"application-notification_title": "fallback-title " + default_notification_title,
"application-notification_body": notification_body,
"application-notification_format": 'text',
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
assert b"Settings updated." in res.data
@@ -480,8 +475,7 @@ def test_check_plaintext_document_plaintext_notification_smtp(client, live_serve
"application-notification_title": "fallback-title " + default_notification_title,
"application-notification_body": f"{notification_body}\nMore output test\n{ALL_MARKUP_TOKENS}",
"application-notification_format": 'text',
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
assert b"Settings updated." in res.data
@@ -533,8 +527,7 @@ def test_check_plaintext_document_html_notifications(client, live_server, measur
"application-notification_title": "fallback-title " + default_notification_title,
"application-notification_body": f"{notification_body}\nMore output test\n{ALL_MARKUP_TOKENS}",
"application-notification_format": 'html',
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
assert b"Settings updated." in res.data
@@ -613,8 +606,7 @@ def test_check_plaintext_document_html_color_notifications(client, live_server,
"application-notification_title": "fallback-title " + default_notification_title,
"application-notification_body": f"{notification_body}\nMore output test\n{ALL_MARKUP_TOKENS}",
"application-notification_format": 'htmlcolor',
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
@@ -686,8 +678,7 @@ def test_check_html_document_plaintext_notification(client, live_server, measure
"application-notification_title": "fallback-title " + default_notification_title,
"application-notification_body": f"{notification_body}\nMore output test\n{ALL_MARKUP_TOKENS}",
"application-notification_format": 'text',
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
@@ -740,8 +731,7 @@ def test_check_html_notification_with_apprise_format_is_html(client, live_server
"application-notification_title": "fallback-title " + default_notification_title,
"application-notification_body": "some text\nfallback-body<br> " + default_notification_body,
"application-notification_format": 'html',
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
assert b"Settings updated." in res.data
@@ -32,8 +32,7 @@ def test_check_access_control(app, client, live_server, measure_memory_usage, da
url_for("settings.settings_page"),
data={"application-password": "foobar",
"application-shared_diff_access": "True",
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
@@ -91,8 +90,7 @@ def test_check_access_control(app, client, live_server, measure_memory_usage, da
res = c.post(
url_for("settings.settings_page"),
data={
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
@@ -132,11 +130,11 @@ def test_check_access_control(app, client, live_server, measure_memory_usage, da
##################################################
# Remove password button, and check that it worked
##################################################
c.post(url_for("settings_browsers.set_default"), data={"machine_name": "browser_chromeplaywright", "csrf_token": ""}, follow_redirects=True)
res = c.post(
url_for("settings.settings_page"),
data={
"requests-time_between_check-minutes": 180,
"application-browser_profile": "browser_chromeplaywright",
"application-removepassword_button": "Remove password"
},
follow_redirects=True,
@@ -150,8 +148,7 @@ def test_check_access_control(app, client, live_server, measure_memory_usage, da
res = c.post(
url_for("settings.settings_page"),
data={"application-password": "",
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
@@ -164,8 +161,7 @@ def test_check_access_control(app, client, live_server, measure_memory_usage, da
data={"application-password": "foobar",
# Should be disabled
"application-shared_diff_access": "",
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
@@ -127,8 +127,7 @@ def test_check_add_line_contains_trigger(client, live_server, measure_memory_usa
# https://github.com/caronc/apprise/wiki/Notify_Custom_JSON#get-parameter-manipulation
"application-notification_urls": test_notification_url,
"application-notification_format": 'text',
"application-minutes_between_check": 180,
"application-browser_profile": "direct_http_requests"
"application-minutes_between_check": 180
},
follow_redirects=True
)
+1 -4
View File
@@ -416,7 +416,6 @@ def test_access_denied(client, live_server, measure_memory_usage, datastore_path
url_for("settings.settings_page"),
data={
"requests-time_between_check-minutes": 180,
"application-browser_profile": "direct_http_requests",
"application-api_access_token_enabled": ""
},
follow_redirects=True
@@ -436,7 +435,6 @@ def test_access_denied(client, live_server, measure_memory_usage, datastore_path
url_for("settings.settings_page"),
data={
"requests-time_between_check-minutes": 180,
"application-browser_profile": "direct_http_requests",
"application-api_access_token_enabled": "y"
},
follow_redirects=True
@@ -907,8 +905,7 @@ def test_api_conflict_UI_password(client, live_server, measure_memory_usage, dat
url_for("settings.settings_page"),
data={"application-password": "foobar", # password is now set! API should still work!
"application-api_access_token_enabled": "y",
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
@@ -177,7 +177,6 @@ def test_openapi_validation_get_requests_bypass_validation(client, live_server,
url_for("settings.settings_page"),
data={
"requests-time_between_check-minutes": 180,
"application-browser_profile": "direct_http_requests",
"application-api_access_token_enabled": ""
},
follow_redirects=True
+3 -6
View File
@@ -172,8 +172,7 @@ def test_title_scraper(client, live_server, measure_memory_usage, datastore_path
res = client.post(
url_for("settings.settings_page"),
data={"application-ui-use_page_title_in_list": "",
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
@@ -215,8 +214,7 @@ def test_requests_timeout(client, live_server, measure_memory_usage, datastore_p
url_for("settings.settings_page"),
data={"application-ui-use_page_title_in_list": "",
"requests-time_between_check-minutes": 180,
"requests-timeout": delay - 1,
'application-browser_profile': "direct_http_requests"},
"requests-timeout": delay - 1},
follow_redirects=True
)
@@ -234,8 +232,7 @@ def test_requests_timeout(client, live_server, measure_memory_usage, datastore_p
url_for("settings.settings_page"),
data={"application-ui-use_page_title_in_list": "",
"requests-time_between_check-minutes": 180,
"requests-timeout": delay + 1, # timeout should be a second more than the reply time
'application-browser_profile': "direct_http_requests"},
"requests-timeout": delay + 1}, # timeout should be a second more than the reply time
follow_redirects=True
)
client.get(url_for("ui.form_watch_checknow"), follow_redirects=True)
@@ -118,8 +118,7 @@ def test_everything(live_server, client, measure_memory_usage, datastore_path):
res = client.post(
url_for("settings.settings_page"),
data={"application-password": "foobar",
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
@@ -50,8 +50,7 @@ def test_consistent_history(client, live_server, measure_memory_usage, datastore
res = client.post(
url_for("settings.settings_page"),
data={"application-empty_pages_are_a_change": "",
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
assert b"Settings updated." in res.data
+1 -2
View File
@@ -68,8 +68,7 @@ def test_strip_ignore_lines(client, live_server, measure_memory_usage, datastore
"requests-time_between_check-minutes": 180,
"application-ignore_whitespace": "y",
"application-strip_ignored_lines": "y",
"application-global_ignore_text": "Which is across multiple",
'application-browser_profile': "direct_http_requests"
"application-global_ignore_text": "Which is across multiple"
},
follow_redirects=True
)
+1 -2
View File
@@ -181,8 +181,7 @@ def _run_test_global_ignore(client, datastore_path, as_source=False, extra_ignor
data={
"requests-time_between_check-minutes": 180,
"application-ignore_whitespace": "y",
"application-global_ignore_text": ignore_text,
'application-browser_profile': "direct_http_requests"
"application-global_ignore_text": ignore_text
},
follow_redirects=True
)
@@ -53,7 +53,6 @@ def test_render_anchor_tag_content_true(client, live_server, measure_memory_usag
url_for("settings.settings_page"),
data={
"requests-time_between_check-minutes": 180,
"application-browser_profile": "direct_http_requests",
},
follow_redirects=True,
)
@@ -90,7 +89,6 @@ def test_render_anchor_tag_content_true(client, live_server, measure_memory_usag
data={
"requests-time_between_check-minutes": 180,
"application-render_anchor_tag_content": "true",
"application-browser_profile": "direct_http_requests",
},
follow_redirects=True,
)
@@ -49,8 +49,7 @@ def test_normal_page_check_works_with_ignore_status_code(client, live_server, me
url_for("settings.settings_page"),
data={
"requests-time_between_check-minutes": 180,
"application-ignore_status_codes": "y",
'application-browser_profile': "direct_http_requests"
"application-ignore_status_codes": "y"
},
follow_redirects=True
)
@@ -58,8 +58,7 @@ def test_check_ignore_whitespace(client, live_server, measure_memory_usage, data
url_for("settings.settings_page"),
data={
"requests-time_between_check-minutes": 180,
"application-ignore_whitespace": "y",
"application-browser_profile": "direct_http_requests"
"application-ignore_whitespace": "y"
},
follow_redirects=True
)
@@ -50,8 +50,7 @@ def test_check_basic_change_detection_functionality(client, live_server, measure
client.post(
url_for("settings.settings_page"),
data={"application-empty_pages_are_a_change": "", # default, OFF, they are NOT a change
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
@@ -81,8 +80,7 @@ def test_check_basic_change_detection_functionality(client, live_server, measure
client.post(
url_for("settings.settings_page"),
data={"application-empty_pages_are_a_change": "y",
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
set_modified_response(datastore_path=datastore_path)
+1 -6
View File
@@ -41,8 +41,7 @@ def test_check_notification(client, live_server, measure_memory_usage, datastore
"application-notification_title": "fallback-title "+default_notification_title,
"application-notification_body": "fallback-body "+default_notification_body,
"application-notification_format": default_notification_format,
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
@@ -282,7 +281,6 @@ def test_notification_urls_jinja2_apprise_integration(client, live_server, measu
res = client.post(
url_for("settings.settings_page"),
data={
"application-browser_profile": "direct_http_requests",
"application-minutes_between_check": 180,
"application-notification_body": '{ "url" : "{{ watch_url }}", "secret": 444, "somebug": "网站监测 内容更新了", "another": "{{diff|truncate(1500)}}" }',
"application-notification_format": default_notification_format,
@@ -314,7 +312,6 @@ def test_notification_custom_endpoint_and_jinja2(client, live_server, measure_me
res = client.post(
url_for("settings.settings_page"),
data={
"application-browser_profile": "direct_http_requests",
"application-minutes_between_check": 180,
"application-notification_body": '{ "url" : "{{ watch_url }}", "secret": 444, "somebug": "网站监测 内容更新了" }',
"application-notification_format": default_notification_format,
@@ -399,7 +396,6 @@ def test_global_send_test_notification(client, live_server, measure_memory_usage
res = client.post(
url_for("settings.settings_page"),
data={
"application-browser_profile": "direct_http_requests",
"application-minutes_between_check": 180,
"application-notification_body": test_body,
"application-notification_format": default_notification_format,
@@ -556,7 +552,6 @@ def _test_color_notifications(client, notification_body_token, datastore_path):
res = client.post(
url_for("settings.settings_page"),
data={
"application-browser_profile": "direct_http_requests",
"application-minutes_between_check": 180,
"application-notification_body": notification_body_token,
"application-notification_format": "htmlcolor",
-2
View File
@@ -253,7 +253,6 @@ def test_ua_global_override(client, live_server, measure_memory_usage, datastore
res = client.post(
url_for("settings.settings_page"),
data={
"application-browser_profile": "direct_http_requests",
"application-minutes_between_check": 180,
"requests-default_ua-html_requests": "html-requests-user-agent"
},
@@ -311,7 +310,6 @@ def test_headers_textfile_in_request(client, live_server, measure_memory_usage,
test_url = test_url.replace('localhost', 'cdio')
form_data = {
"application-browser_profile": "direct_http_requests",
"application-minutes_between_check": 180,
"requests-default_ua-html_requests": requests_ua
}
@@ -361,8 +361,7 @@ def test_change_with_notification_values(client, live_server, measure_memory_usa
"application-notification_title": "title new price {{restock.price}}",
"application-notification_body": "new price {{restock.price}} previous price {{restock.previous_price}} instock {{restock.in_stock}}",
"application-notification_format": default_notification_format,
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
@@ -273,7 +273,6 @@ def test_rss_single_watch_follow_notification_body(client, live_server, measure_
res = client.post(
url_for("settings.settings_page"),
data={
"application-browser_profile": "direct_http_requests",
"application-minutes_between_check": 180,
"application-notification_body": 'Boo yeah hello from main settings notification body<br>\nTitle: {{ watch_title }} changed',
"application-notification_format": default_notification_format,
+1 -3
View File
@@ -24,8 +24,7 @@ def test_check_basic_scheduler_functionality(client, live_server, measure_memory
url_for("settings.settings_page"),
data={"application-empty_pages_are_a_change": "",
"requests-time_between_check-seconds": 1,
"application-scheduler_timezone_default": "Pacific/Kiritimati", # Most Forward Time Zone (UTC+14:00)
'application-browser_profile': "direct_http_requests"},
"application-scheduler_timezone_default": "Pacific/Kiritimati"}, # Most Forward Time Zone (UTC+14:00)
follow_redirects=True
)
@@ -120,7 +119,6 @@ def test_check_basic_global_scheduler_functionality(client, live_server, measure
data = {
"application-empty_pages_are_a_change": "",
"application-scheduler_timezone_default": "Pacific/Kiritimati", # Most Forward Time Zone (UTC+14:00)
'application-browser_profile': "direct_http_requests",
"requests-time_between_check-hours": 0,
"requests-time_between_check-minutes": 0,
"requests-time_between_check-seconds": 1,
+1 -2
View File
@@ -159,8 +159,7 @@ def test_xss(client, live_server, measure_memory_usage, datastore_path):
"application-notification_title": '"><img src=x onerror=alert(document.domain)>',
"application-notification_body": '"><img src=x onerror=alert(document.domain)>',
"application-notification_format": default_notification_format,
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
@@ -54,8 +54,7 @@ def test_settings_change_forces_reprocess(client, live_server, measure_memory_us
url_for("settings.settings_page"),
data={
"application-empty_pages_are_a_change": "",
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"
"requests-time_between_check-minutes": 180
},
follow_redirects=True
)
+2 -4
View File
@@ -179,8 +179,7 @@ def test_page_title_listing_behaviour(client, live_server, measure_memory_usage,
res = client.post(
url_for("settings.settings_page"),
data={"application-ui-use_page_title_in_list": "",
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
assert b"Settings updated." in res.data
@@ -219,8 +218,7 @@ def test_page_title_listing_behaviour(client, live_server, measure_memory_usage,
res = client.post(
url_for("settings.settings_page"),
data={"application-ui-use_page_title_in_list": "y",
"requests-time_between_check-minutes": 180,
'application-browser_profile': "direct_http_requests"},
"requests-time_between_check-minutes": 180},
follow_redirects=True
)
assert b"Settings updated." in res.data
+5
View File
@@ -378,6 +378,11 @@ async def async_update_worker(worker_id, q, notification_q, app, datastore, exec
process_changedetection_results = False
logger.error(f"Exception (BrowserStepsInUnsupportedFetcher) reached processing watch UUID: {uuid}")
except KeyError as e:
# Watch was deleted between being queued and processed — skip
logger.warning(f"Worker {worker_id} skipping UUID {uuid}: {e}")
process_changedetection_results = False
except Exception as e:
import traceback
logger.error(f"Worker {worker_id} exception processing watch UUID: {uuid}")