summaryrefslogtreecommitdiff
path: root/bs4/testing.py
diff options
context:
space:
mode:
Diffstat (limited to 'bs4/testing.py')
-rw-r--r--bs4/testing.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/bs4/testing.py b/bs4/testing.py
index 5b0eb8f..bbcc271 100644
--- a/bs4/testing.py
+++ b/bs4/testing.py
@@ -319,6 +319,14 @@ Hello, world!
def test_angle_brackets_in_attribute_values_are_escaped(self):
self.assertSoupEquals('<a b="<a>"></a>', '<a b="&lt;a&gt;"></a>')
+ def test_strings_resembling_character_entity_references(self):
+ # "&T" and "&p" look like incomplete character entities, but they are
+ # not.
+ self.assertSoupEquals(
+ u"<p>&bull; AT&T is in the s&p 500</p>",
+ u"<p>\u2022 AT&amp;T is in the s&amp;p 500</p>"
+ )
+
def test_entities_in_attributes_converted_to_unicode(self):
expect = u'<p id="pi\N{LATIN SMALL LETTER N WITH TILDE}ata"></p>'
self.assertSoupEquals('<p id="pi&#241;ata"></p>', expect)