diff --git a/changedetectionio/processors/restock_diff/processor.py b/changedetectionio/processors/restock_diff/processor.py index d51f9166c..4c07b9e05 100644 --- a/changedetectionio/processors/restock_diff/processor.py +++ b/changedetectionio/processors/restock_diff/processor.py @@ -198,10 +198,10 @@ class perform_site_check(difference_detection_processor): # out of stock -> back in stock only? if watch.get('restock') and watch['restock'].get('in_stock') != update_obj['restock'].get('in_stock'): # Yes if we only care about it going to instock, AND we are in stock - if restock_settings.get('in_stock_only') and update_obj['restock']['in_stock']: + if restock_settings.get('in_stock_processing') == 'in_stock_only' and update_obj['restock']['in_stock']: changed_detected = True - if not restock_settings.get('in_stock_only'): + if restock_settings.get('in_stock_processing') == 'all_changes': # All cases changed_detected = True diff --git a/changedetectionio/tests/test_restock_itemprop.py b/changedetectionio/tests/test_restock_itemprop.py index e342f5110..4fa7814d2 100644 --- a/changedetectionio/tests/test_restock_itemprop.py +++ b/changedetectionio/tests/test_restock_itemprop.py @@ -52,6 +52,8 @@ def test_restock_itemprop_basic(client, live_server): test_url = url_for('test_endpoint', _external=True) + # By default it should enable ('in_stock_processing') == 'all_changes' + for p in instock_props: set_original_response(props_markup=p) client.post( @@ -87,6 +89,7 @@ def test_restock_itemprop_basic(client, live_server): def test_itemprop_price_change(client, live_server): #live_server_setup(live_server) + # Out of the box 'Follow price changes' should be ON test_url = url_for('test_endpoint', _external=True) set_original_response(props_markup=instock_props[0], price="190.95")