MCPcopy
hub / github.com/django/django / test_parse_html_in_script

Method test_parse_html_in_script

tests/test_utils/tests.py:716–729  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

714 self.assertEqual(dom[0], "foo")
715
716 def test_parse_html_in_script(self):
717 parse_html('<script>var a = "<p" + ">";</script>')
718 parse_html("""
719 <script>
720 var js_sha_link='<p>***</p>';
721 </script>
722 """)
723
724 # script content will be parsed to text
725 dom = parse_html("""
726 <script><p>foo</p> '</scr'+'ipt>' <span>bar</span></script>
727 """)
728 self.assertEqual(len(dom.children), 1)
729 self.assertEqual(dom.children[0], "<p>foo</p> '</scr'+'ipt>' <span>bar</span>")
730
731 def test_void_elements(self):
732 for tag in VOID_ELEMENTS:

Callers

nothing calls this directly

Calls 1

parse_htmlFunction · 0.90

Tested by

no test coverage detected