def test_safe_parse_xml(self):
- normal_body = ("""
- <?xml version="1.0" ?><foo>
- <bar>
- <v1>hey</v1>
- <v2>there</v2>
- </bar>
- </foo>""").strip()
+ normal_body = ('<?xml version="1.0" ?>'
+ '<foo><bar><v1>hey</v1><v2>there</v2></bar></foo>')
def killer_body():
return (("""<!DOCTYPE x [
}).strip()
dom = utils.safe_minidom_parse_string(normal_body)
- self.assertEqual(normal_body, str(dom.toxml()))
+ # Some versions of minidom inject extra newlines so we ignore them
+ result = str(dom.toxml()).replace('\n', '')
+ self.assertEqual(normal_body, result)
self.assertRaises(ValueError,
utils.safe_minidom_parse_string,