#19688: add back and deprecate the internal HTMLParser.unescape() method.

This commit is contained in:
Ezio Melotti 2013-11-22 05:49:29 +02:00
parent 32f0c7a67b
commit f6de9eb2bb
2 changed files with 14 additions and 0 deletions

View file

@ -569,6 +569,13 @@ class HTMLParserTolerantTestCase(HTMLParserStrictTestCase):
for html, expected in data:
self._run_check(html, expected)
def test_unescape_method(self):
from html import unescape
p = self.get_collector()
with self.assertWarns(DeprecationWarning):
s = '"""&quot&#34&#x22&#bad;'
self.assertEqual(p.unescape(s), unescape(s))
def test_broken_comments(self):
html = ('<! not really a comment >'
'<! not a comment either -->'