Adding test
This commit is contained in:
@@ -554,7 +554,10 @@ def changedetection_app(config=None, datastore_o=None):
|
|||||||
|
|
||||||
watch = datastore.data['watching'].get(watch_uuid)
|
watch = datastore.data['watching'].get(watch_uuid)
|
||||||
|
|
||||||
notification_urls = request.form['notification_urls'].strip().splitlines()
|
notification_urls = None
|
||||||
|
|
||||||
|
if request.form.get('notification_urls'):
|
||||||
|
notification_urls = request.form['notification_urls'].strip().splitlines()
|
||||||
|
|
||||||
if not notification_urls:
|
if not notification_urls:
|
||||||
logger.debug("Test notification - Trying by group/tag in the edit form if available")
|
logger.debug("Test notification - Trying by group/tag in the edit form if available")
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import os
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
from flask import url_for
|
from flask import url_for
|
||||||
from .util import live_server_setup, wait_for_all_checks, wait_for_notification_endpoint_output
|
from .util import live_server_setup, wait_for_all_checks, wait_for_notification_endpoint_output, extract_UUID_from_client
|
||||||
from ..notification import default_notification_format
|
from ..notification import default_notification_format
|
||||||
|
|
||||||
instock_props = [
|
instock_props = [
|
||||||
@@ -367,6 +367,12 @@ def test_change_with_notification_values(client, live_server):
|
|||||||
assert "new price 1950.45" in notification
|
assert "new price 1950.45" in notification
|
||||||
assert "title new price 1950.45" in notification
|
assert "title new price 1950.45" in notification
|
||||||
|
|
||||||
|
## Now test the "SEND TEST NOTIFICATION" is working
|
||||||
|
os.unlink("test-datastore/notification.txt")
|
||||||
|
uuid = extract_UUID_from_client(client)
|
||||||
|
res = client.post(url_for("ajax_callback_send_notification_test", watch_uuid=uuid), data={}, follow_redirects=True)
|
||||||
|
time.sleep(5)
|
||||||
|
assert os.path.isfile("test-datastore/notification.txt"), "Notification received"
|
||||||
|
|
||||||
|
|
||||||
def test_data_sanity(client, live_server):
|
def test_data_sanity(client, live_server):
|
||||||
|
|||||||
Reference in New Issue
Block a user