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())
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" )
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' )
from django.contrib.auth.models import User from voting.models import Vote from voting.managers import VoteManager from hypotheses.models import Hypothesis from evidences.models import EvidenceType, Evidence from UTIs.models import Summary, Description, Commentary u=User.objects.all()[0] u2=User.objects.all()[1] u3=User.objects.all()[2] h=Hypothesis(proposer=u,originator_name="Joe Bloggs",originator_unique="@joebloggs",status="Straw Man",proposer_description="This is a straw man hypothesis") h.save() d1=Description(content="This is a straw man hypotheses consisting of basically nothing at all",desc_object=h,originator=u) d1.save() s1=Summary(content="A boring hypothesis consisteing of nothing much at all blah blah balhhk ahdlhd kjah dkahd kadh akjdha kjdh akhd jahdjah duysgf kadsf iuhf oihg kadgf ihf iqgf oieg[oegooigwu iuh weug uehf poeuf ieh fieh fue fi [epouoiger w[oejg [owejg oewug", originator=u,summ_object=h) s1.save() evt=EvidenceType(name="Journal article") evt.save() evt2=EvidenceType(name="blog post") evt2.save() ev=Evidence(hypothesis=h,url="http://strawman.com", originator_name="Blog Joes",originator_unique="@BJ",introducer=u,uri="strawman",evidence_type=evt) ev.save() ed1=Description(content="some evidence shows Xand Y but not Z", originator=u,summ_object=ev) ed1.save()