Exemple #1
0
 def test_animal_unicode(self):
     """This is a test for creating a new animal object, with only the minimum fields being entered.  It then tests that the correct unicode representation is being generated."""
     animal = Animal(Strain = Strain.objects.get(pk=1), Genotype="-/-", Background="Mixed")
     animal.save()
     animal_id = animal.id
     self.assertEquals(animal.__unicode__(), "Fixture Strain (5)")
     animal.MouseID = 1234
     animal.save()
     self.assertEquals(animal.__unicode__(), "Fixture Strain-EarTag #1234")
Exemple #2
0
 def test_unicode(self):
     """This is a test for creating a new animal object, with only the minimum fields being entered.  It then tests that the correct unicode representation is being generated."""
     example_strain = Strain(Strain="Example Strain")
     example_strain.save()
     animal = Animal(Strain = example_strain, Genotype="-/-", Background="Mixed")
     animal.save()
     animal_id = animal.id
     self.assertEquals(animal.__unicode__(), "Example Strain (%s)" % animal_id)
     animal.MouseID = 1234
     animal.save()
     self.assertEquals(animal.__unicode__(), "Example Strain-EarTag #1234")
     print "animal_unicode... passed"