summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_xml_etree.py
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2013-01-10 14:27:53 (GMT)
committerEli Bendersky <eliben@gmail.com>2013-01-10 14:27:53 (GMT)
commite6174ca85e293039c464e06bf3a656300347b562 (patch)
treef78ed07b81f69ea07374c3199bdf6556683704eb /Lib/test/test_xml_etree.py
parent458c0d5a776746267f432e6860050af367fb5431 (diff)
downloadcpython-e6174ca85e293039c464e06bf3a656300347b562.zip
cpython-e6174ca85e293039c464e06bf3a656300347b562.tar.gz
cpython-e6174ca85e293039c464e06bf3a656300347b562.tar.bz2
Issue #16913: Fix Element.itertext()'s handling of text with XML entities.
Patch by Serhiy Storchaka
Diffstat (limited to 'Lib/test/test_xml_etree.py')
-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')