diff options
Diffstat (limited to 'bs4/testing.py')
-rw-r--r-- | bs4/testing.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bs4/testing.py b/bs4/testing.py index fd4495a..ce207cf 100644 --- a/bs4/testing.py +++ b/bs4/testing.py @@ -254,6 +254,16 @@ class HTMLTreeBuilderSmokeTest(object): self.assertEqual("p", soup.h2.string.next_element.name) self.assertEqual("p", soup.p.name) + def test_head_tag_between_head_and_body(self): + "Prevent recurrence of a bug in the html5lib treebuilder." + content = """<html><head></head> + <link></link> + <body>foo</body> +</html> +""" + soup = self.soup(content) + self.assertNotEqual(None, soup.html.body) + def test_basic_namespaces(self): """Parsers don't need to *understand* namespaces, but at the very least they should not choke on namespaces or lose |