mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2026-01-03 22:00:19 +00:00
Compare commits
2 Commits
0.46.02
...
post-reque
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3f6b92670 | ||
|
|
1813977133 |
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Read more https://github.com/dgtlmoon/changedetection.io/wiki
|
# Read more https://github.com/dgtlmoon/changedetection.io/wiki
|
||||||
|
|
||||||
__version__ = '0.46.02'
|
__version__ = '0.46.01'
|
||||||
|
|
||||||
from changedetectionio.strtobool import strtobool
|
from changedetectionio.strtobool import strtobool
|
||||||
from json.decoder import JSONDecodeError
|
from json.decoder import JSONDecodeError
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ def test_check_add_line_contains_trigger(client, live_server, measure_memory_usa
|
|||||||
res = client.post(
|
res = client.post(
|
||||||
url_for("settings_page"),
|
url_for("settings_page"),
|
||||||
data={"application-notification_title": "New ChangeDetection.io Notification - {{ watch_url }}",
|
data={"application-notification_title": "New ChangeDetection.io Notification - {{ watch_url }}",
|
||||||
"application-notification_body": 'triggered text was -{{triggered_text}}- 网站监测 内容更新了',
|
"application-notification_body": 'triggered text was -{{triggered_text}}-',
|
||||||
# https://github.com/caronc/apprise/wiki/Notify_Custom_JSON#get-parameter-manipulation
|
# https://github.com/caronc/apprise/wiki/Notify_Custom_JSON#get-parameter-manipulation
|
||||||
"application-notification_urls": test_notification_url,
|
"application-notification_urls": test_notification_url,
|
||||||
"application-minutes_between_check": 180,
|
"application-minutes_between_check": 180,
|
||||||
@@ -167,10 +167,9 @@ def test_check_add_line_contains_trigger(client, live_server, measure_memory_usa
|
|||||||
# Takes a moment for apprise to fire
|
# Takes a moment for apprise to fire
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
assert os.path.isfile("test-datastore/notification.txt"), "Notification fired because I can see the output file"
|
assert os.path.isfile("test-datastore/notification.txt"), "Notification fired because I can see the output file"
|
||||||
with open("test-datastore/notification.txt", 'rb') as f:
|
with open("test-datastore/notification.txt", 'r') as f:
|
||||||
response = f.read()
|
response= f.read()
|
||||||
assert b'-Oh yes please-' in response
|
assert '-Oh yes please-' in response
|
||||||
assert '网站监测 内容更新了'.encode('utf-8') in response
|
|
||||||
|
|
||||||
|
|
||||||
res = client.get(url_for("form_delete", uuid="all"), follow_redirects=True)
|
res = client.get(url_for("form_delete", uuid="all"), follow_redirects=True)
|
||||||
|
|||||||
@@ -291,11 +291,11 @@ def test_notification_custom_endpoint_and_jinja2(client, live_server, measure_me
|
|||||||
data={
|
data={
|
||||||
"application-fetch_backend": "html_requests",
|
"application-fetch_backend": "html_requests",
|
||||||
"application-minutes_between_check": 180,
|
"application-minutes_between_check": 180,
|
||||||
"application-notification_body": '{ "url" : "{{ watch_url }}", "secret": 444, "somebug": "网站监测 内容更新了" }',
|
"application-notification_body": '{ "url" : "{{ watch_url }}", "secret": 444 }',
|
||||||
"application-notification_format": default_notification_format,
|
"application-notification_format": default_notification_format,
|
||||||
"application-notification_urls": test_notification_url,
|
"application-notification_urls": test_notification_url,
|
||||||
# https://github.com/caronc/apprise/wiki/Notify_Custom_JSON#get-parameter-manipulation
|
# https://github.com/caronc/apprise/wiki/Notify_Custom_JSON#get-parameter-manipulation
|
||||||
"application-notification_title": "New ChangeDetection.io Notification - {{ watch_url }} ",
|
"application-notification_title": "New ChangeDetection.io Notification - {{ watch_url }}",
|
||||||
},
|
},
|
||||||
follow_redirects=True
|
follow_redirects=True
|
||||||
)
|
)
|
||||||
@@ -324,7 +324,6 @@ def test_notification_custom_endpoint_and_jinja2(client, live_server, measure_me
|
|||||||
j = json.loads(x)
|
j = json.loads(x)
|
||||||
assert j['url'].startswith('http://localhost')
|
assert j['url'].startswith('http://localhost')
|
||||||
assert j['secret'] == 444
|
assert j['secret'] == 444
|
||||||
assert j['somebug'] == '网站监测 内容更新了'
|
|
||||||
|
|
||||||
# URL check, this will always be converted to lowercase
|
# URL check, this will always be converted to lowercase
|
||||||
assert os.path.isfile("test-datastore/notification-url.txt")
|
assert os.path.isfile("test-datastore/notification-url.txt")
|
||||||
@@ -355,10 +354,9 @@ def test_notification_custom_endpoint_and_jinja2(client, live_server, measure_me
|
|||||||
#2510
|
#2510
|
||||||
def test_global_send_test_notification(client, live_server, measure_memory_usage):
|
def test_global_send_test_notification(client, live_server, measure_memory_usage):
|
||||||
|
|
||||||
|
|
||||||
#live_server_setup(live_server)
|
#live_server_setup(live_server)
|
||||||
set_original_response()
|
set_original_response()
|
||||||
if os.path.isfile("test-datastore/notification.txt"):
|
|
||||||
os.unlink("test-datastore/notification.txt")
|
|
||||||
|
|
||||||
# otherwise other settings would have already existed from previous tests in this file
|
# otherwise other settings would have already existed from previous tests in this file
|
||||||
res = client.post(
|
res = client.post(
|
||||||
@@ -366,8 +364,7 @@ def test_global_send_test_notification(client, live_server, measure_memory_usage
|
|||||||
data={
|
data={
|
||||||
"application-fetch_backend": "html_requests",
|
"application-fetch_backend": "html_requests",
|
||||||
"application-minutes_between_check": 180,
|
"application-minutes_between_check": 180,
|
||||||
#1995 UTF-8 content should be encoded
|
"application-notification_body": 'change detection is cool',
|
||||||
"application-notification_body": 'change detection is cool 网站监测 内容更新了',
|
|
||||||
"application-notification_format": default_notification_format,
|
"application-notification_format": default_notification_format,
|
||||||
"application-notification_urls": "",
|
"application-notification_urls": "",
|
||||||
"application-notification_title": "New ChangeDetection.io Notification - {{ watch_url }}",
|
"application-notification_title": "New ChangeDetection.io Notification - {{ watch_url }}",
|
||||||
@@ -402,7 +399,8 @@ def test_global_send_test_notification(client, live_server, measure_memory_usage
|
|||||||
|
|
||||||
with open("test-datastore/notification.txt", 'r') as f:
|
with open("test-datastore/notification.txt", 'r') as f:
|
||||||
x = f.read()
|
x = f.read()
|
||||||
assert 'change detection is cool 网站监测 内容更新了' in x
|
assert 'change detection is coo' in x
|
||||||
|
|
||||||
|
|
||||||
os.unlink("test-datastore/notification.txt")
|
os.unlink("test-datastore/notification.txt")
|
||||||
|
|
||||||
@@ -422,7 +420,7 @@ def test_global_send_test_notification(client, live_server, measure_memory_usage
|
|||||||
with open("test-datastore/notification.txt", 'r') as f:
|
with open("test-datastore/notification.txt", 'r') as f:
|
||||||
x = f.read()
|
x = f.read()
|
||||||
# Should come from notification.py default handler when there is no notification body to pull from
|
# Should come from notification.py default handler when there is no notification body to pull from
|
||||||
assert 'change detection is cool 网站监测 内容更新了' in x
|
assert 'change detection is coo' in x
|
||||||
|
|
||||||
client.get(
|
client.get(
|
||||||
url_for("form_delete", uuid="all"),
|
url_for("form_delete", uuid="all"),
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ dnspython==2.6.1 # related to eventlet fixes
|
|||||||
# jq not available on Windows so must be installed manually
|
# jq not available on Windows so must be installed manually
|
||||||
|
|
||||||
# Notification library
|
# Notification library
|
||||||
apprise~=1.8.1
|
apprise~=1.8.0
|
||||||
|
|
||||||
# apprise mqtt https://github.com/dgtlmoon/changedetection.io/issues/315
|
# apprise mqtt https://github.com/dgtlmoon/changedetection.io/issues/315
|
||||||
# and 2.0.0 https://github.com/dgtlmoon/changedetection.io/issues/2241 not yet compatible
|
# and 2.0.0 https://github.com/dgtlmoon/changedetection.io/issues/2241 not yet compatible
|
||||||
|
|||||||
Reference in New Issue
Block a user