Skip to content

Commit

Permalink
Adding extra test for #2103
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtlmoon committed Jan 14, 2024
1 parent 1749c07 commit 0f206dc
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion changedetectionio/tests/smtp/test_notification_smtp.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,25 @@ def test_check_notification_email_formats_default_Text_override_HTML(client, liv
set_original_response()
global smtp_test_server
notification_url = f'mailto://changedetection@{smtp_test_server}:11025/?to=fff@home.com'
notification_body = f"""<!DOCTYPE html>
<html lang="en">
<head>
<title>My Webpage</title>
</head>
<body>
<h1>Test</h1>
{default_notification_body}
</body>
</html>
"""

#####################
# Set this up for when we remove the notification from the watch, it should fallback with these details
res = client.post(
url_for("settings_page"),
data={"application-notification_urls": notification_url,
"application-notification_title": "fallback-title " + default_notification_title,
"application-notification_body": default_notification_body,
"application-notification_body": notification_body,
"application-notification_format": 'Text',
"requests-time_between_check-minutes": 180,
'application-fetch_backend': "html_requests"},
Expand Down Expand Up @@ -161,5 +172,10 @@ def test_check_notification_email_formats_default_Text_override_HTML(client, liv
assert 'Content-Type: text/html' in msg
assert '(removed) So let\'s see what happens.<br>' in msg # the html part

# https://github.com/dgtlmoon/changedetection.io/issues/2103
assert '<h1>Test</h1>' in msg
assert '&lt;' not in msg
assert 'Content-Type: text/html' in msg

res = client.get(url_for("form_delete", uuid="all"), follow_redirects=True)
assert b'Deleted' in res.data

0 comments on commit 0f206dc

Please sign in to comment.