summaryrefslogtreecommitdiff
path: root/Lib/test/test_htmlparser.py
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2010-12-28 16:05:07 +0000
committerSenthil Kumaran <orsenthil@gmail.com>2010-12-28 16:05:07 +0000
commit3f60f09eb23be3289ac5cc019391711dcdf800b3 (patch)
tree25930497b54b42a4c61318d5ede15fded795d149 /Lib/test/test_htmlparser.py
parent06fdbedf81c49fd9614379ebd68d6388525bf42f (diff)
downloadcpython-git-3f60f09eb23be3289ac5cc019391711dcdf800b3.tar.gz
Fix Issue10759 - HTMLParser.unescape() to handle malform charrefs.
Diffstat (limited to 'Lib/test/test_htmlparser.py')
-rw-r--r--Lib/test/test_htmlparser.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_htmlparser.py b/Lib/test/test_htmlparser.py
index c45cf00ece..717585ca5b 100644
--- a/Lib/test/test_htmlparser.py
+++ b/Lib/test/test_htmlparser.py
@@ -320,6 +320,11 @@ DOCTYPE html [
("endtag", "p"),
])
+ def test_unescape_function(self):
+ parser = HTMLParser.HTMLParser()
+ self.assertEqual(parser.unescape('&#bad;'),'&#bad;')
+ self.assertEqual(parser.unescape('&#0038;'),'&')
+
def test_main():
test_support.run_unittest(HTMLParserTestCase)