This commit is contained in:
dgtlmoon
2025-10-06 19:07:32 +02:00
parent 2e1e301915
commit bd3e2dc9c9
5 changed files with 118 additions and 78 deletions

View File

@@ -8,8 +8,6 @@ from ..diff import ADDED_STYLE, DIFF_HTML_LABEL_ADDED
sleep_time_for_fetch_thread = 3
def test_check_basic_change_detection_functionality_source(client, live_server, measure_memory_usage):
set_original_response()
test_url = 'source:'+url_for('test_endpoint', _external=True)
@@ -52,9 +50,12 @@ def test_check_basic_change_detection_functionality_source(client, live_server,
url_for("ui.ui_views.diff_history_page", uuid="first"),
follow_redirects=True
)
assert f'{DIFF_HTML_LABEL_ADDED.format(content="modified ")}head title</title></head>'.encode('utf-8') in res.data
# With diff-match-patch, HTML tags are properly tokenized and excluded from diff spans
# Only "modified" is shown as added, while <head> and <title> tags remain unchanged
assert b'&lt;head&gt;&lt;title&gt;' in res.data
assert b'title="Added"' in res.data
assert b'>modified<' in res.data
assert b'head title&lt;/title&gt;&lt;/head&gt;' in res.data
# `subtractive_selectors` should still work in `source:` type requests