summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2011-10-01 16:49:25 -0400
committerR David Murray <rdmurray@bitdance.com>2011-10-01 16:49:25 -0400
commitc8faf9bb0cdd5faa957fbd3aa38b637c68cdee34 (patch)
treecbf020223e488d654547b93dcf0328023341ed2a /Lib/test
parentf06eb46918f11220d13e7170dcb17929498e3294 (diff)
downloadcpython-git-c8faf9bb0cdd5faa957fbd3aa38b637c68cdee34.tar.gz
#4147: minidom's toprettyxml no longer adds whitespace to text nodes.
Patch by Dan Kenigsberg.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_minidom.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py
index 7b7524a122..ecf05dd2e2 100644
--- a/Lib/test/test_minidom.py
+++ b/Lib/test/test_minidom.py
@@ -439,6 +439,13 @@ class MinidomTest(unittest.TestCase):
dom.unlink()
self.confirm(domstr == str.replace("\n", "\r\n"))
+ def test_toPrettyXML_perserves_content_of_text_node(self):
+ str = '<A>B</A>'
+ dom = parseString(str)
+ dom2 = parseString(dom.toprettyxml())
+ self.assertEqual(dom.childNodes[0].childNodes[0].toxml(),
+ dom2.childNodes[0].childNodes[0].toxml())
+
def testProcessingInstruction(self):
dom = parseString('<e><?mypi \t\n data \t\n ?></e>')
pi = dom.documentElement.firstChild