summaryrefslogtreecommitdiff
path: root/tests/test_soup.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2011-02-22 22:56:09 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2011-02-22 22:56:09 -0500
commit6d7422139b7a60f48761f9a8ef52ed3de7393287 (patch)
tree6cacead21b43bb5de23947a414c5d949c0d6c434 /tests/test_soup.py
parent1c32da9882d056fee65d8c2aa44ecacfc21eb758 (diff)
Solved the question of how to decide between &apos; (XML) and &squot; (HTML) by cutting the Gordian knot: quote the *double* quotes, which are always &quot;.
Diffstat (limited to 'tests/test_soup.py')
-rw-r--r--tests/test_soup.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/tests/test_soup.py b/tests/test_soup.py
index 5df49bc..c4d9c2c 100644
--- a/tests/test_soup.py
+++ b/tests/test_soup.py
@@ -53,15 +53,9 @@ class TestEntitySubstitution(unittest.TestCase):
def test_xml_attribute_quoting_escapes_single_quotes_when_value_contains_both_single_and_double_quotes(self):
s = 'Welcome to "Bob\'s Bar"'
- # This one is going into an HTML document.
self.assertEquals(
self.sub.substitute_xml(s, True),
- "'Welcome to \"Bob&squot;s Bar\"'")
-
- # This one is going into an XML document.
- self.assertEquals(
- self.sub.substitute_xml(s, True, destination_is_xml=True),
- "'Welcome to \"Bob&apos;s Bar\"'")
+ '"Welcome to &quot;Bob\'s Bar&quot;"')
def test_xml_quotes_arent_escaped_when_value_is_not_being_quoted(self):
quoted = 'Welcome to "Bob\'s Bar"'