summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_xml_etree.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2012-09-19 05:25:01 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2012-09-19 05:25:01 (GMT)
commitab9b661fdd4201e2471d7816dd5bf834385c9da2 (patch)
tree0113654c5432c245b8d6f2d3fe8346c098008d4d /Lib/test/test_xml_etree.py
parentda064d074556cb61309e13193d0b353668f76a49 (diff)
parentc90111f9ab617a1dbdde8952a4b81e6eecc36e7c (diff)
downloadcpython-ab9b661fdd4201e2471d7816dd5bf834385c9da2.zip
cpython-ab9b661fdd4201e2471d7816dd5bf834385c9da2.tar.gz
cpython-ab9b661fdd4201e2471d7816dd5bf834385c9da2.tar.bz2
#15970: merge with 3.2.
Diffstat (limited to 'Lib/test/test_xml_etree.py')
-rw-r--r--Lib/test/test_xml_etree.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
index da1ad09..97d64fc 100644
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -1809,6 +1809,18 @@ class ElementTreeTest(unittest.TestCase):
mye = MyElement('joe')
self.assertEqual(mye.newmethod(), 'joe')
+ def test_html_empty_elems_serialization(self):
+ # issue 15970
+ # from http://www.w3.org/TR/html401/index/elements.html
+ for element in ['AREA', 'BASE', 'BASEFONT', 'BR', 'COL', 'FRAME', 'HR',
+ 'IMG', 'INPUT', 'ISINDEX', 'LINK', 'META', 'PARAM']:
+ for elem in [element, element.lower()]:
+ expected = '<%s>' % elem
+ serialized = serialize(ET.XML('<%s />' % elem), method='html')
+ self.assertEqual(serialized, expected)
+ serialized = serialize(ET.XML('<%s></%s>' % (elem,elem)),
+ method='html')
+ self.assertEqual(serialized, expected)
class ElementIterTest(unittest.TestCase):
def _ilist(self, elem, tag=None):