Skip to content
Snippets Groups Projects
Commit 1373f0a2 authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

bug fix in test, actually test if h2 is produced

parent 3b5a5fa4
No related branches found
No related tags found
1 merge request!237add a switch to disable markdown for the whole app
......@@ -557,6 +557,7 @@ class OtherWithDataTestCase(BaseTestCase):
def test_call_html_allowed_and_injection_prevented(self):
h2_str = "hello world"
h2_html = '<h2>' + h2_str
img_tag = '<img src="foo.bar"/>'
img_tag_md = '![image](daa.too)'
img_tag_from_md = markdown(img_tag_md)
......@@ -567,7 +568,7 @@ class OtherWithDataTestCase(BaseTestCase):
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
content_str = str(response.content)
self.assertIn(h2_str, content_str, "an h2 should be rendered, is markdown working?")
self.assertIn(h2_html, content_str, "an h2 should be rendered, is markdown working?")
self.assertNotIn(img_tag, content_str, "<img is not allowed yet")
self.assertIn(img_tag_from_md, content_str, "<img should produced after ![image]")
self.assertNotIn(script_tag, content_str, "<script should still be prevented")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment