summaryrefslogtreecommitdiff
path: root/bs4/testing.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2015-09-28 19:39:00 -0400
committerLeonard Richardson <leonardr@segfault.org>2015-09-28 19:39:00 -0400
commit14ef81a14cd42a180edfafeb926e4142d94473ec (patch)
treed23db8acea1df2c113e97e9e08de17187fa9ef9b /bs4/testing.py
parenta7896851618d81ceab30f2e0d6024a63710a2728 (diff)
downloadbeautifulsoup4-14ef81a14cd42a180edfafeb926e4142d94473ec.tar.gz
Corrected the output of Declaration objects. [bug=1477847]
Diffstat (limited to 'bs4/testing.py')
-rw-r--r--bs4/testing.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/bs4/testing.py b/bs4/testing.py
index 9e5e295..847c9fc 100644
--- a/bs4/testing.py
+++ b/bs4/testing.py
@@ -556,6 +556,11 @@ class XMLTreeBuilderSmokeTest(object):
self.assertEqual(
soup.encode(), b'<?xml version="1.0" encoding="utf-8"?>\n<root/>')
+ def test_xml_declaration(self):
+ markup = b"""<?xml version="1.0" encoding="utf8"?>\n<foo/>"""
+ soup = self.soup(markup)
+ self.assertEqual(markup, soup.encode("utf8"))
+
def test_real_xhtml_document(self):
"""A real XHTML document should come out *exactly* the same as it went in."""
markup = b"""<?xml version="1.0" encoding="utf-8"?>