summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test_html5lib.py9
-rw-r--r--tests/test_lxml.py4
2 files changed, 11 insertions, 2 deletions
diff --git a/tests/test_html5lib.py b/tests/test_html5lib.py
index 3efdebf..1034720 100644
--- a/tests/test_html5lib.py
+++ b/tests/test_html5lib.py
@@ -3,6 +3,7 @@ from beautifulsoup.element import Comment
from test_lxml import (
TestLXMLBuilder,
TestLXMLBuilderInvalidMarkup,
+ TestLXMLBuilderEncodingConversion,
)
class TestHTML5Builder(TestLXMLBuilder):
@@ -138,3 +139,11 @@ class TestHTML5BuilderInvalidMarkup(TestLXMLBuilderInvalidMarkup):
utf8 = utf8.replace("\xe9", "\xc3\xa9")
#print soup
+
+
+class TestHTML5LibEncodingConversion(TestLXMLBuilderEncodingConversion):
+ @property
+ def default_builder(self):
+ return HTML5TreeBuilder()
+
+ pass
diff --git a/tests/test_lxml.py b/tests/test_lxml.py
index 0f54e78..1218763 100644
--- a/tests/test_lxml.py
+++ b/tests/test_lxml.py
@@ -383,10 +383,10 @@ class TestLXMLBuilderEncodingConversion(SoupTest):
def setUp(self):
super(TestLXMLBuilderEncodingConversion, self).setUp()
- self.unicode_data = u"<html><body><foo>\xe9</foo></body></html>"
+ self.unicode_data = u"<html><head></head><body><foo>\xe9</foo></body></html>"
self.utf8_data = self.unicode_data.encode("utf-8")
self.assertEqual(
- self.utf8_data, "<html><body><foo>\xc3\xa9</foo></body></html>")
+ self.utf8_data, "<html><head></head><body><foo>\xc3\xa9</foo></body></html>")
def test_ascii_in_unicode_out(self):
# ASCII input is converted to Unicode. The originalEncoding