diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2012-02-23 12:23:12 -0500 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2012-02-23 12:23:12 -0500 |
commit | fcefebe15290b9ff44934efa73fb07c70ebf5171 (patch) | |
tree | c0b3ae8837a96975e1b88f3e2e9befc07a72e70c /bs4/testing.py | |
parent | b7749c50a2c96ccf6982cfa1ca02d883e31e0af9 (diff) |
Fixed handling of the closing of namespaced tags.
Diffstat (limited to 'bs4/testing.py')
-rw-r--r-- | bs4/testing.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bs4/testing.py b/bs4/testing.py index 1945c02..6f9d857 100644 --- a/bs4/testing.py +++ b/bs4/testing.py @@ -371,6 +371,17 @@ class XMLTreeBuilderSmokeTest(object): soup.encode("latin1"), b'<?xml version="1.0" encoding="latin1">\n<root/>') + def test_real_xhtml_document(self): + """A real XHTML document should come out the same as it went in.""" + markup = b"""<?xml version="1.0" encoding="utf-8"> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head><title>Hello.</title></head> +<body>Goodbye.</body> +</html>""" + soup = self.soup(markup) + self.assertEqual(soup.encode("utf-8"), markup) + def test_tags_are_empty_element_if_and_only_if_they_are_empty(self): self.assertSoupEquals("<p>", "<p/>") |