def insert_test_species(clean=False): if clean: clean_species() iucn_cat = IucnRedListCategory.objects.get(code='LC') with reversion.create_revision(): element_species = ElementSpecies() element_species.other_code = "lontra_cnd" element_species.iucn_red_list_category = iucn_cat element_species.save() species = Species() species.tsn = 180549 species.first_common = 'North American river otter' species.name_sci = 'Lontra canadensis' species.element_species = element_species species.family = 'Mustelidae' species.family_common = 'Mustelids' species.phylum = 'Chordata' species.phylum_common = 'Chordates' species.save() element_species = ElementSpecies() element_species.other_code = "bl_bear" element_species.iucn_red_list_category = iucn_cat element_species.save() species = Species() species.tsn = 180544 species.first_common = 'American black bear' species.name_sci = 'Ursus americanus' species.element_species = element_species species.family = 'Ursidae' species.family_common = 'Bears' species.phylum = 'Chordata' species.phylum_common = 'Chordate' species.save()