def test_members_json(self): actual_json = """ {{ "{root_tag}": [{{ {actual_json_base} }}] }} """.format(root_tag=self.ROOT_TAG, actual_json_base=self.actual_json_base, **self.member_attribute_kwargs) actual_obj = Members.deserialize(actual_json, 'json') self.assertEqual(self.expected_obj, actual_obj)
def test_members_xml(self): actual_xml = """{xml_header} <{root_tag} xmlns="{xmlns}"> <{child_tag} {actual_xml_base} /> </{root_tag}>""".format( xml_header=self.XML_HEADER, xmlns=self.XML_NS, root_tag=self.ROOT_TAG, child_tag=self.CHILD_TAG, actual_xml_base=self.actual_xml_base, **self.member_attribute_kwargs) actual_obj = Members.deserialize(actual_xml, 'xml') self.assertEqual(self.expected_obj, actual_obj)