We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 60ad399 commit 393923fCopy full SHA for 393923f
1 file changed
Lib/test/test_minidom.py
@@ -5,6 +5,7 @@
5
import io
6
from test import support
7
import unittest
8
+from xml.etree import ElementTree
9
10
import xml.dom.minidom
11
@@ -1663,5 +1664,14 @@ def test_cdata_parsing(self):
1663
1664
dom2 = parseString(dom1.toprettyxml())
1665
self.checkWholeText(dom2.getElementsByTagName('node')[0].firstChild, '</data>')
1666
1667
+ def testQuoteEscape(self):
1668
+ text = ElementTree.Element('text')
1669
+ text.text = 'f&oo"b<a>r'
1670
+ xml_string = ElementTree.tostring(text)
1671
+ xml_tree = parseString(xml_string)
1672
+ output = xml_tree.toprettyxml(indent=' ')
1673
+ self.assertEqual(output.splitlines()[1], xml_string.decode('utf8'))
1674
+
1675
1676
if __name__ == "__main__":
1677
unittest.main()
0 commit comments