From 1f4d0856119ee0b06ea607830b8c630bc08bd557 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Wed, 22 Feb 2012 12:25:42 -0500 Subject: Bare strings are not HTML-escaped by default, but tags are. --- bs4/testing.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'bs4/testing.py') diff --git a/bs4/testing.py b/bs4/testing.py index b82a640..49f50a5 100644 --- a/bs4/testing.py +++ b/bs4/testing.py @@ -227,10 +227,9 @@ class HTMLTreeBuilderSmokeTest(object): def test_entities_converted_on_the_way_out(self): text = "

<<sacré bleu!>>

" - expected = u"<<sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>>".encode("utf-8") + expected = u"

<<sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>>

".encode("utf-8") soup = self.soup(text) - str = soup.p.string - self.assertEqual(str.encode("utf-8"), expected) + self.assertEqual(soup.p.encode("utf-8"), expected) def test_real_iso_latin_document(self): # Smoke test of interrelated functionality, using an -- cgit v1.2.3