diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2012-04-16 10:35:13 -0400 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2012-04-16 10:35:13 -0400 |
commit | 3793495c8ea91243f9689d9788d30b9c6e0740d7 (patch) | |
tree | dcd1ab0c20b98ebe31aa1be9e00ab4e0aa0cc059 /bs4/tests | |
parent | 0afe0af7cd8240ab790ccbcea6ecbdf69f21461e (diff) |
Unicode, Dammit now has an option to turn MS smart quotes into ASCII characters.
Diffstat (limited to 'bs4/tests')
-rw-r--r-- | bs4/tests/test_soup.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bs4/tests/test_soup.py b/bs4/tests/test_soup.py index d826b25..ddbffd4 100644 --- a/bs4/tests/test_soup.py +++ b/bs4/tests/test_soup.py @@ -191,6 +191,12 @@ class TestUnicodeDammit(unittest.TestCase): self.assertEqual( dammit.unicode_markup, "<foo>‘’“”</foo>") + def test_smart_quotes_to_ascii(self): + markup = b"<foo>\x91\x92\x93\x94</foo>" + dammit = UnicodeDammit(markup, smart_quotes_to="ascii") + self.assertEqual( + dammit.unicode_markup, """<foo>''""</foo>""") + def test_detect_utf8(self): utf8 = b"\xc3\xa9" dammit = UnicodeDammit(utf8) |