From 1373f0a26d24048159b148a8cadd660e2b49611b Mon Sep 17 00:00:00 2001 From: Bryan Brancotte <bryan.brancotte@pasteur.fr> Date: Mon, 17 Feb 2025 18:04:04 +0100 Subject: [PATCH] bug fix in test, actually test if h2 is produced --- src/strass/strass_app/tests/test_views_others.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/strass/strass_app/tests/test_views_others.py b/src/strass/strass_app/tests/test_views_others.py index cafbd4a3..de5de7de 100644 --- a/src/strass/strass_app/tests/test_views_others.py +++ b/src/strass/strass_app/tests/test_views_others.py @@ -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 = '' 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") -- GitLab