summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2013-01-10 14:31:05 (GMT)
committerEli Bendersky <eliben@gmail.com>2013-01-10 14:31:05 (GMT)
commitbb48151c8c2721e9430c892629d29dbdd30fa4ab (patch)
treebb88777fc748e3de508899c6c6ae5951fb3f5737 /Lib/test
parente474022192cecc37efb7102e8c3fbc56b43d47e1 (diff)
parente6174ca85e293039c464e06bf3a656300347b562 (diff)
downloadcpython-bb48151c8c2721e9430c892629d29dbdd30fa4ab.zip
cpython-bb48151c8c2721e9430c892629d29dbdd30fa4ab.tar.gz
cpython-bb48151c8c2721e9430c892629d29dbdd30fa4ab.tar.bz2
Issue #16913: Fix Element.itertext()'s handling of text with XML entities.
Patch by Serhiy Storchaka
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_xml_etree.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
index 9746934..68dd1cc 100644
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -1904,6 +1904,10 @@ class ElementIterTest(unittest.TestCase):
tree = ET.ElementTree(None)
self.assertRaises(AttributeError, tree.iter)
+ # Issue #16913
+ doc = ET.XML("<root>a&amp;<sub>b&amp;</sub>c&amp;</root>")
+ self.assertEqual(''.join(doc.itertext()), 'a&b&c&')
+
def test_corners(self):
# single root, no subelements
a = ET.Element('a')