summaryrefslogtreecommitdiff
path: root/tests/test_soup.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2011-02-18 12:53:33 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2011-02-18 12:53:33 -0500
commitb5fa9d7f5579f22f5fe0f7c9dc63e0aa7d29262f (patch)
treef089e9dee8109e0fdfae2589cd8228d4ddee5939 /tests/test_soup.py
parent5962a409b04b8a78d78e9186da97bedbb67df8e6 (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.py8
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>&#x2018;&#x2019;&#x201C;&#x201D;</foo>")
def test_smart_quotes_to_html_entities(self):