Exemplo n.º 1
0
 def test_create_studey_detailed(self):
     """This is a test for creating a new study object, with all fields being entered.  It also verifies that unicode is set correctly.  This test is dependent on the ability to create a new Strain object (see animal.tests.StrainModelTests.test_create_minimal_strain)."""
     new_study = Study(
         description = "Effects of x on y",
         start_date = datetime.date.today(),
         stop_date = datetime.date.today(),
         notes = "some notes on this strain"
         )
     new_study.save()
     new_study.strain.create(Strain='test_strain')
     self.assertEquals(new_study.__unicode__(), u'Effects of x on y')
Exemplo n.º 2
0
 def test_study_absolute_url(self):
     """This test verifies that the absolute url of a study object is set correctly.  This study is dependend on a positive result on test_create_study_minimal."""
     test_study = Study(description = "Effects of x on y")
     test_study.save()
     self.assertEquals(test_study.get_absolute_url(), '/studies/1/')
Exemplo n.º 3
0
 def test_create_study_minimal(self):
     """This is a test for creating a new study object, with only the minimum being entered.  It also verifies that unicode is set correctly."""
     new_study = Study(description = "Effects of x on y")
     new_study.save()
     self.assertEquals(new_study.__unicode__(), u'Effects of x on y')