diff options
Diffstat (limited to 'Lib/test/test_xml_etree.py')
-rw-r--r-- | Lib/test/test_xml_etree.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py index b7a996c..3092f3b 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -1851,6 +1851,26 @@ def check_issue10777(): >>> ET.register_namespace('test10777', 'http://myuri/') """ +def check_html_empty_elems_serialization(self): + # issue 15970 + # from http://www.w3.org/TR/html401/index/elements.html + """ + + >>> empty_elems = ['AREA', 'BASE', 'BASEFONT', 'BR', 'COL', 'FRAME', 'HR', + ... 'IMG', 'INPUT', 'ISINDEX', 'LINK', 'META', 'PARAM'] + >>> elems = ''.join('<%s />' % elem for elem in empty_elems) + >>> serialize(ET.XML('<html>%s</html>' % elems), method='html') + '<html><AREA><BASE><BASEFONT><BR><COL><FRAME><HR><IMG><INPUT><ISINDEX><LINK><META><PARAM></html>' + >>> serialize(ET.XML('<html>%s</html>' % elems.lower()), method='html') + '<html><area><base><basefont><br><col><frame><hr><img><input><isindex><link><meta><param></html>' + >>> elems = ''.join('<%s></%s>' % (elem, elem) for elem in empty_elems) + >>> serialize(ET.XML('<html>%s</html>' % elems), method='html') + '<html><AREA><BASE><BASEFONT><BR><COL><FRAME><HR><IMG><INPUT><ISINDEX><LINK><META><PARAM></html>' + >>> serialize(ET.XML('<html>%s</html>' % elems.lower()), method='html') + '<html><area><base><basefont><br><col><frame><hr><img><input><isindex><link><meta><param></html>' + + """ + # -------------------------------------------------------------------- |