diff options
-rw-r--r-- | NEWS.txt | 5 | ||||
-rw-r--r-- | bs4/tests/test_soup.py | 5 |
2 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,8 @@ += Unreleased + +* Fixed the test_detect_utf8 test so that it works when chardet is + installed. [bug=1471359] + = 4.4.0 (20150703) = Especially important changes: diff --git a/bs4/tests/test_soup.py b/bs4/tests/test_soup.py index 3643aed..1238af2 100644 --- a/bs4/tests/test_soup.py +++ b/bs4/tests/test_soup.py @@ -299,10 +299,11 @@ class TestUnicodeDammit(unittest.TestCase): dammit.unicode_markup, """<foo>''""</foo>""") def test_detect_utf8(self): - utf8 = b"\xc3\xa9" + utf8 = b"Sacr\xc3\xa9 bleu! \xe2\x98\x83" dammit = UnicodeDammit(utf8) - self.assertEqual(dammit.unicode_markup, u'\xe9') self.assertEqual(dammit.original_encoding.lower(), 'utf-8') + self.assertEqual(dammit.unicode_markup, u'Sacr\xe9 bleu! \N{SNOWMAN}') + def test_convert_hebrew(self): hebrew = b"\xed\xe5\xec\xf9" |