diff --git a/nova/tests/api/openstack/test_xmlutil.py b/nova/tests/api/openstack/test_xmlutil.py index 3ed6a86fc3b6..c1a799757db6 100644 --- a/nova/tests/api/openstack/test_xmlutil.py +++ b/nova/tests/api/openstack/test_xmlutil.py @@ -726,16 +726,13 @@ class MiscellaneousXMLUtilTests(test.TestCase): def test_safe_parse_xml(self): - normal_body = (""" - - - hey - there - - """).strip() + normal_body = ('' + 'heythere') dom = xmlutil.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(exception.MalformedRequestBody, xmlutil.safe_minidom_parse_string,