#2927: Added the unescape() function to the html module.

This commit is contained in:
Ezio Melotti 2013-11-19 20:28:45 +02:00
parent 5160da1afc
commit 4a9ee26750
7 changed files with 215 additions and 49 deletions

View file

@ -569,18 +569,6 @@ class HTMLParserTolerantTestCase(HTMLParserStrictTestCase):
for html, expected in data:
self._run_check(html, expected)
def test_unescape_function(self):
p = self.get_collector()
self.assertEqual(p.unescape('&#bad;'),'&#bad;')
self.assertEqual(p.unescape('&'),'&')
# see #12888
self.assertEqual(p.unescape('{ ' * 1050), '{ ' * 1050)
# see #15156
self.assertEqual(p.unescape('&EacutericÉric'
'&alphacentauriαcentauri'),
'ÉricÉric&alphacentauriαcentauri')
self.assertEqual(p.unescape('&co;'), '&co;')
def test_broken_comments(self):
html = ('<! not really a comment >'
'<! not a comment either -->'