def test_save_models(self): path = os.getcwd() + "/wcdb_app/WorldCrises.xml" root = verifyXML(xml_file_as_str(path)) saveModels(root[0]) p = Person.objects.get(xml_id='PER_MNSNGH') c = Crisis.objects.get(xml_id='CRI_NRINFL') self.assertEqual(p.name, 'Manmohan Singh') self.assertEqual(c.kind, 'Natural Disaster') exportModels()
def test_export_models(self): path = os.getcwd() + "/wcdb/wcdb_app/xml_files/init.xml" root = verifyXML(xml_file_as_str(path)) saveModels(root[0]) export = exportModels() result = verifyXML(export) self.assertEqual(type(result[0]), ET.Element)