|
|
@ -14,14 +14,16 @@ def test_check_notification(client, live_server):
|
|
|
|
# Give the endpoint time to spin up
|
|
|
|
# Give the endpoint time to spin up
|
|
|
|
time.sleep(3)
|
|
|
|
time.sleep(3)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# re #242 - when you edited an existing new entry, it would not correctly show the notification settings
|
|
|
|
|
|
|
|
|
|
|
|
# Add our URL to the import page
|
|
|
|
# Add our URL to the import page
|
|
|
|
test_url = url_for('test_endpoint', _external=True)
|
|
|
|
test_url = url_for('test_endpoint', _external=True)
|
|
|
|
res = client.post(
|
|
|
|
res = client.post(
|
|
|
|
url_for("import_page"),
|
|
|
|
url_for("api_watch_add"),
|
|
|
|
data={"urls": test_url},
|
|
|
|
data={"url": test_url, "tag": ''},
|
|
|
|
follow_redirects=True
|
|
|
|
follow_redirects=True
|
|
|
|
)
|
|
|
|
)
|
|
|
|
assert b"1 Imported" in res.data
|
|
|
|
assert b"Watch added" in res.data
|
|
|
|
|
|
|
|
|
|
|
|
# Give the thread time to pick up the first version
|
|
|
|
# Give the thread time to pick up the first version
|
|
|
|
time.sleep(3)
|
|
|
|
time.sleep(3)
|
|
|
@ -61,6 +63,10 @@ def test_check_notification(client, live_server):
|
|
|
|
url_for("edit_page", uuid="first"))
|
|
|
|
url_for("edit_page", uuid="first"))
|
|
|
|
assert bytes(notification_url.encode('utf-8')) in res.data
|
|
|
|
assert bytes(notification_url.encode('utf-8')) in res.data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Re #242 - wasnt saving?
|
|
|
|
|
|
|
|
assert bytes("New ChangeDetection.io Notification".encode('utf-8')) in res.data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Because we hit 'send test notification on save'
|
|
|
|
# Because we hit 'send test notification on save'
|
|
|
|
time.sleep(3)
|
|
|
|
time.sleep(3)
|
|
|
|