summaryrefslogtreecommitdiff
path: root/tests/test_tree.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_tree.py')
-rw-r--r--tests/test_tree.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_tree.py b/tests/test_tree.py
index 0b3d72e..249e7ae 100644
--- a/tests/test_tree.py
+++ b/tests/test_tree.py
@@ -830,6 +830,19 @@ class TestPersistence(SoupTest):
class TestSubstitutions(SoupTest):
+ def test_entity_substitution(self):
+ soup = self.soup(
+ u"<b>Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!</b>")
+ encoded = soup.encode("utf-8", replace_with_html_entities=True)
+ self.assertEquals(encoded,
+ self.document_for("<b>Sacr&eacute; bleu!</b>"))
+
+ def test_entity_substitution_off_by_default(self):
+ markup = u"<b>Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!</b>"
+ soup = self.soup(markup)
+ encoded = soup.b.encode("utf-8")
+ self.assertEquals(encoded, markup.encode('utf-8'))
+
def test_encoding_substitution(self):
# Here's the <meta> tag saying that a document is
# encoded in Shift-JIS.