Beispiel #1
0
def test_create_hypothesis_create_date(self):
    """This is a test for checking that the create and modified date are being set correctly."""
    test_hypothesis = Hypothesis(manipulation=Manipulation.objects.get(pk=1),
                                 effect=Effect.objects.get(pk=1),
                                 process=Process.objects.get(pk=1))
    test_hypothesis.save()
    self.assertEquals(
        test_hypothesis.__unicode__(),
        "Fixture Protein Overexpression positively regulates glucose import")
    self.assertEquals(test_hypothesis.create_date, datetime.date.today())
    self.assertEquals(test_hypothesis.modified_date, datetime.date.today())
Beispiel #2
0
 def test_create_hypothesis_minimal(self):
     """This is a test for creating a new Hypothesis object, with only the minimum fields being entered.  It also tests the unicode representation."""
     test_hypothesis = Hypothesis(
         manipulation=Manipulation.objects.get(pk=1),
         effect=Effect.objects.get(pk=1),
         process=Process.objects.get(pk=1))
     test_hypothesis.save()
     self.assertEquals(
         test_hypothesis.__unicode__(),
         "Fixture Protein Overexpression positively regulates glucose import"
     )
Beispiel #3
0
 def test_create_hypothesis_all_fields_process(self):
     """This is a test for creating a new Hypothesis object, with all fields being entered.  There is one test for process and one for entity (since both cannot be entered simultaneously).  It also tests the unicode representation."""
     test_hypothesis = Hypothesis(
         manipulation=Manipulation.objects.get(pk=1),
         effect=Effect.objects.get(pk=1),
         process=Process.objects.get(pk=1),
         context=Context.objects.get(pk=1),
     )
     test_hypothesis.save()
     test_evidence = Evidence.objects.get(pk=1)
     test_hypothesis.evidence.add(
         test_evidence)  # tests the addition of evidence as a m2m field
     test_hypothesis.identical_hypotheses.add(
         test_hypothesis
     )  # tests the addition of a symmetrical hypothesis as a m2m field
     self.assertEquals(
         test_hypothesis.__unicode__(),
         'Fixture Protein Overexpression positively regulates glucose import in Fixture Context'
     )