From b5fa9d7f5579f22f5fe0f7c9dc63e0aa7d29262f Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Fri, 18 Feb 2011 12:53:33 -0500 Subject: By default, Unicode Dammit converts smart quotes to Unicode characters, not XML entities. --- tests/test_soup.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests/test_soup.py') 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,9 +19,15 @@ 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 = "\x91\x92\x93\x94" dammit = UnicodeDammit(markup) + self.assertEquals( + dammit.unicode, u"\u2018\u2019\u201c\u201d") + + def test_smart_quotes_to_xml_entities(self): + markup = "\x91\x92\x93\x94" + dammit = UnicodeDammit(markup, smart_quotes_to="xml") self.assertEquals( dammit.unicode, "‘’“”") -- cgit v1.2.3