def test_duplicatedIndividual(self):
     """adding a duplicated individual should return an IntegrityError
     """
     session.flush()
     clone = Individual('clone')
     clone_again = Individual('clone')
     self.assertRaises(IntegrityError, session.commit)
     session.rollback()
 def test_insertIndividual(self):
     """test the insertion of a few individuals and populations
     """
     session.flush()
     me = Individual('Giovanni')
     hannibal = Individual('Annibal')
     
     # create populations
     italians = Population('Italians')
     cartaginians = Population('Cartaginians')    
     
     me.population = italians
     hannibal.population = cartaginians