diff --git a/changedetectionio/model/Watch.py b/changedetectionio/model/Watch.py index 83bfb2e38..7ff8f7f0d 100644 --- a/changedetectionio/model/Watch.py +++ b/changedetectionio/model/Watch.py @@ -217,6 +217,8 @@ class model(dict): fname = os.path.join(self.watch_data_dir, "history.txt") if os.path.isfile(fname): logger.debug(f"Reading watch history index for {self.get('uuid')}") + + with open(fname, "r") as f: for i in f.readlines(): if ',' in i: diff --git a/changedetectionio/tests/test_automatic_follow_ldjson_price.py b/changedetectionio/tests/test_automatic_follow_ldjson_price.py index 7da76962e..7f1b22cea 100644 --- a/changedetectionio/tests/test_automatic_follow_ldjson_price.py +++ b/changedetectionio/tests/test_automatic_follow_ldjson_price.py @@ -81,7 +81,7 @@ def test_setup(client, live_server): # actually only really used by the distll.io importer, but could be handy too def test_check_ldjson_price_autodetect(client, live_server): - + #live_server_setup(live_server) set_response_with_ldjson() # Add our URL to the import page @@ -113,6 +113,9 @@ def test_check_ldjson_price_autodetect(client, live_server): # and last snapshop (via API) should be just the price api_key = extract_api_key_from_UI(client) + # Time for writes to happen to history text + time.sleep(0.5) + res = client.get( url_for("watchsinglehistory", uuid=uuid, timestamp='latest'), headers={'x-api-key': api_key},