def test_region_create_deleted_duplicate_name(self): self.truncate_table("regions") values = { 'name': self.region_name, } expect = db.region_create(self.context, values) db.region_destroy(self.context, expect.id) actual = db.region_create(self.context, values) self.compare_records(expect, actual, skip_id=True)
def test_region_destroy(self): self.truncate_table("regions") values = { 'name': self.region_name, } expect = db.region_create(self.context, values) db.region_destroy(self.context, expect.id) self.assertRaises(exception.RegionNotFoundByName, db.region_get_by_name, self.context, self.region_name) self.assertRaises(exception.RegionNotFound, db.region_get, self.context, expect.id)