Skip to content

Commit 7ee9652

Browse files
test(spp_audit,spp_change_request_v2): assert escaped entities in XSS tests
Add assertIn("&lt;script&gt;") to two tests that only checked absence of raw <script> tags, confirming the escaped data is actually present.
1 parent aeb197f commit 7ee9652

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

spp_audit/tests/test_html_escaping.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,4 @@ def test_parent_data_html_escapes_script_tags(self):
8787
)
8888
html = log.parent_data_html
8989
self.assertNotIn("<script>", html)
90+
self.assertIn("&lt;script&gt;", html)

spp_change_request_v2/tests/test_html_escaping.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def test_registrant_summary_escapes_spp_id(self):
6868
cr.invalidate_recordset()
6969
html = cr.registrant_summary_html
7070
self.assertNotIn("<script>", html)
71+
self.assertIn("&lt;script&gt;", html)
7172

7273
def test_preview_html_escapes_field_values(self):
7374
"""Verify _generate_preview_html escapes dynamic values."""

0 commit comments

Comments
 (0)