def test_defang_html_on_snippet_missing_b_close(self): html = """\ <div class="mouf"><p><span><img/>Hello <b>World!<script>... </script></p></div>""" safer_html = """\ <p> <img/>Hello <b>World!</b> </p> """ output = defang_html(html) self.assertEqual(safer_html,output)
def test_defang_html_on_snippet_missing_b_close(self): html = """\ <div class="mouf"><p><span><img/>Hello <b>World!<script>... </script></p></div>""" safer_html = """\ <p> <img/>Hello <b>World!</b> </p> """ output = defang_html(html) self.assertEqual(safer_html, output)
def test_defang_html_on_correct_html(self): html = """\ <div class="mouf"><p><span><img/>Hello</span><b>World!</b><script>... </script></p></div>""" safer_html = """\ <p> <img/>Hello <b>World!</b></p> """ output = defang_html(html) self.assertEqual(safer_html,output)
def test_defang_html_on_correct_html(self): html = """\ <div class="mouf"><p><span><img/>Hello</span><b>World!</b><script>... </script></p></div>""" safer_html = """\ <p> <img/>Hello <b>World!</b></p> """ output = defang_html(html) self.assertEqual(safer_html, output)