From 8f4071e9702e4ecda8b427938558ff307567a469 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Fri, 23 Oct 2026 17:20:44 +0200 Subject: [PATCH] Tests - Don't assert the input type of the restock threshold field, WTForms 3.3 renders FloatField as type="number" wtforms~=3.2 now installs 3.3.0, which changed FloatField's widget from a text input to a number input, so test_itemprop_percent_threshold failed on every branch. The value is still saved and rendered correctly; only check that. Co-Authored-By: Claude Opus 5.5 --- changedetectionio/tests/test_restock_itemprop.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/changedetectionio/tests/test_restock_itemprop.py b/changedetectionio/tests/test_restock_itemprop.py index a13456a74..b7d5c7695 100644 --- a/changedetectionio/tests/test_restock_itemprop.py +++ b/changedetectionio/tests/test_restock_itemprop.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +import re import os import time @@ -339,7 +340,9 @@ def test_itemprop_percent_threshold(client, live_server, measure_memory_usage, d # And back again live_server.app.config['DATASTORE'].data['watching'][uuid]['processor'] = 'restock_diff' res = client.get(url_for("ui.ui_edit.edit_page", uuid=uuid)) - assert b'type="text" value="5.05"' in res.data + # Don't assert the input type: WTForms 3.3 renders FloatField as type="number", older versions as type="text" + threshold_input = re.search(rb']*name="processor_config_restock_diff-price_change_threshold_percent"[^>]*>', res.data) + assert threshold_input and b'value="5.05"' in threshold_input.group(0) delete_all_watches(client)