diff options
Diffstat (limited to 'bs4/testing.py')
-rw-r--r-- | bs4/testing.py | 8 |
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="<a>"></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>• AT&T is in the s&p 500</p>", + u"<p>\u2022 AT&T is in the s&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ñata"></p>', expect) |