diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-18 12:53:33 -0500 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-18 12:53:33 -0500 |
commit | b5fa9d7f5579f22f5fe0f7c9dc63e0aa7d29262f (patch) | |
tree | f089e9dee8109e0fdfae2589cd8228d4ddee5939 /tests/test_soup.py | |
parent | 5962a409b04b8a78d78e9186da97bedbb67df8e6 (diff) |
By default, Unicode Dammit converts smart quotes to Unicode characters, not XML entities.
Diffstat (limited to 'tests/test_soup.py')
-rw-r--r-- | tests/test_soup.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_soup.py b/tests/test_soup.py index c3a19e1..01dff53 100644 --- a/tests/test_soup.py +++ b/tests/test_soup.py @@ -19,10 +19,16 @@ class TestSelectiveParsing(SoupTest): class TestUnicodeDammit(unittest.TestCase): """Standalone tests of Unicode, Dammit.""" - def test_smart_quotes_to_xml_entities(self): + def test_smart_quotes_to_unicode(self): markup = "<foo>\x91\x92\x93\x94</foo>" dammit = UnicodeDammit(markup) self.assertEquals( + dammit.unicode, u"<foo>\u2018\u2019\u201c\u201d</foo>") + + def test_smart_quotes_to_xml_entities(self): + markup = "<foo>\x91\x92\x93\x94</foo>" + dammit = UnicodeDammit(markup, smart_quotes_to="xml") + self.assertEquals( dammit.unicode, "<foo>‘’“”</foo>") def test_smart_quotes_to_html_entities(self): |