summaryrefslogtreecommitdiff
path: root/bs4/tests/test_soup.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2013-05-20 14:59:32 -0400
committerLeonard Richardson <leonardr@segfault.org>2013-05-20 14:59:32 -0400
commit9ebf90c684990306433b6c364a93b425a88ef2e7 (patch)
treee8cfba2b7e0166cd77512b031d61794b74491ca9 /bs4/tests/test_soup.py
parentb289252da31f1824ee9c85f1ce53907069d6dd7e (diff)
The default XML formatter will now replace ampersands even if they appear to be part of entities. That is, "&lt;" will become "&amp;lt;".[bug=1182183]
Diffstat (limited to 'bs4/tests/test_soup.py')
-rw-r--r--bs4/tests/test_soup.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/bs4/tests/test_soup.py b/bs4/tests/test_soup.py
index dd636d8..b127716 100644
--- a/bs4/tests/test_soup.py
+++ b/bs4/tests/test_soup.py
@@ -125,9 +125,14 @@ class TestEntitySubstitution(unittest.TestCase):
def test_xml_quoting_handles_ampersands(self):
self.assertEqual(self.sub.substitute_xml("AT&T"), "AT&amp;T")
- def test_xml_quoting_ignores_ampersands_when_they_are_part_of_an_entity(self):
+ def test_xml_quoting_including_ampersands_when_they_are_part_of_an_entity(self):
self.assertEqual(
self.sub.substitute_xml("&Aacute;T&T"),
+ "&amp;Aacute;T&amp;T")
+
+ def test_xml_quoting_ignoring_ampersands_when_they_are_part_of_an_entity(self):
+ self.assertEqual(
+ self.sub.substitute_xml_containing_entities("&Aacute;T&T"),
"&Aacute;T&amp;T")
def test_quotes_not_html_substituted(self):