diff options
author | Leonard Richardson <leonardr@segfault.org> | 2013-05-20 14:59:32 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2013-05-20 14:59:32 -0400 |
commit | 9ebf90c684990306433b6c364a93b425a88ef2e7 (patch) | |
tree | e8cfba2b7e0166cd77512b031d61794b74491ca9 /bs4/tests/test_soup.py | |
parent | b289252da31f1824ee9c85f1ce53907069d6dd7e (diff) |
The default XML formatter will now replace ampersands even if they appear to be part of entities. That is, "<" will become "&lt;".[bug=1182183]
Diffstat (limited to 'bs4/tests/test_soup.py')
-rw-r--r-- | bs4/tests/test_soup.py | 7 |
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&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("ÁT&T"), + "&Aacute;T&T") + + def test_xml_quoting_ignoring_ampersands_when_they_are_part_of_an_entity(self): + self.assertEqual( + self.sub.substitute_xml_containing_entities("ÁT&T"), "ÁT&T") def test_quotes_not_html_substituted(self): |