def test_render_and_parse_complex_data(self): """ Test XML rendering. """ renderer = XMLRenderer() content = StringIO(renderer.render(self._complex_data, 'application/xml')) parser = XMLParser() complex_data_out = parser.parse(content) error_msg = "complex data differs!IN:\n %s \n\n OUT:\n %s" % (repr(self._complex_data), repr(complex_data_out)) self.assertEqual(self._complex_data, complex_data_out, error_msg)
def test_complex_data_parse(self): parser = XMLParser() data = parser.parse(self._complex_data_input) self.assertEqual(data, self._complex_data)