def test_create_antibody_all_fields(self): """This is a test for creating a new antibody object, with only the all fields being entered""" test_antibody = Antibody( name = "test antibody", protein_size = "120 kDa", source_species = "rabbit", species = Species.objects.get(pk=1), catalog = "abc1234", location = "-20", box = "sample box", source = "that guy", vendor = Vendor.objects.get(pk=1), notes = "some notes on the object", public = True, published = True) test_antibody.save() test_antibody.researcher.add(Contact.objects.get(pk=1)) test_antibody.protein.add(Protein.objects.get(pk=1)) test_antibody.reference.add(Reference.objects.get(pk=1)) self.assertEquals(test_antibody.__unicode__(), "test antibody")
def test_antibody_slugify(self): """This is a test for the antibody name being correctly slugified""" test_antibody = Antibody(name = "test antibody", source_species = "rabbit") test_antibody.save() self.assertEquals(test_antibody.slug, "test-antibody")
def test_create_antibody_minimal(self): """This is a test for creating a new antibody object, with only the minimum fields being entered""" test_antibody = Antibody(name = "test antibody", source_species = "rabbit") test_antibody.save() self.assertEquals(test_antibody.__unicode__(), "test antibody")