From bc20ac2685c38d76888aeb7adb89dc8665947d7c Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Wed, 30 Jul 2025 13:44:31 +0200 Subject: [PATCH] Add test --- changedetectionio/tests/test_api.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/changedetectionio/tests/test_api.py b/changedetectionio/tests/test_api.py index 2cd87e5b..c8fe2c55 100644 --- a/changedetectionio/tests/test_api.py +++ b/changedetectionio/tests/test_api.py @@ -292,9 +292,7 @@ def test_access_denied(client, live_server, measure_memory_usage): def test_api_watch_PUT_update(client, live_server, measure_memory_usage): - api_key = live_server.app.config['DATASTORE'].data['settings']['application'].get('api_access_token') - # Create a watch set_original_response() test_url = url_for('test_endpoint', _external=True) @@ -302,14 +300,27 @@ def test_api_watch_PUT_update(client, live_server, measure_memory_usage): # Create new res = client.post( url_for("createwatch"), - data=json.dumps({"url": test_url, 'tag': "One, Two", "title": "My test URL", 'headers': {'cookie': 'yum'} }), + data=json.dumps({"url": test_url, + 'tag': "One, Two", + "title": "My test URL", + 'headers': {'cookie': 'yum'}, + "conditions": [ + { + "field": "page_filtered_text", + "operator": "contains_regex", + "value": "." # contains anything + } + ], + "conditions_match_logic": "ALL" + } + ), headers={'content-type': 'application/json', 'x-api-key': api_key}, follow_redirects=True ) assert res.status_code == 201 - + wait_for_all_checks(client) # Get a listing, it will be the first one res = client.get( url_for("createwatch"),