def testBadVersions(self): """ Test very deep form definition created and data saved """ fin = open( get_file("data/bad_version.xsd"), 'r' ) formdef = FormDef(fin) fin.close() try: formdef.validate() self.fail("Should raise a version error") except FormDef.FormDefError, e: pass
def validate_schema(self, file_name): """validate schema Returns a tuple (is_valid, error) is_valid - True if valid, False if not error - Relevant validation error """ fout = open(file_name, 'r') formdef = FormDef(fout) fout.close() try: formdef.validate() except FormDef.FormDefError, e: return False, e