Skip to content

Commit 7d2b950

Browse files
committed
Fix: Updated tests to accomodate preview view now containing character entity references, instead of html tags
1 parent abe7e8d commit 7d2b950

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/test_views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ def test_preview_renders_html(self):
2222

2323
self.assertEqual(self.snippet.html, "<h1>Test Title</h1><br><p>Test paragraph</p>")
2424
self.assertEqual(response.status_code, 200)
25-
self.assertContains(response, "<h1>Test Title</h1><br><p>Test paragraph</p>")
25+
# Removing html escaping, means the content is rendered including the tags on the page, but also means that the
26+
# response will contain character entity references.
27+
self.assertContains(response, "&lt;h1&gt;Test Title&lt;/h1&gt;&lt;br&gt;&lt;p&gt;Test paragraph&lt;/p&gt;")
2628

2729
def test_preview_raises_404_no_snippet(self):
2830
"""

0 commit comments

Comments
 (0)