def testCanPublishPublicAndPrivate(self): # (experiment public: True, access type: private) -> True self.e1.public = True self.publish_data[self.access_type_key] = "private" ph = PublishHandler(self.e1.id, create=True) ph.update(self.publish_data) self.assertTrue(self.provider.can_publish(self.e1))
def testCanPublishPublicAndUnpublished(self): # (experiment public: True, access type: unpublished) -> False self.e1.public = True self.publish_data[self.access_type_key] = "unpublished" ph = PublishHandler(self.e1.id, create=True) ph.update(self.publish_data) self.assertTrue(self.provider.can_publish(self.e1))
def testCanPublishNoProject(self): self.e1.public = True self.e1.save() ph = PublishHandler(self.e1.id, create=True) ph.update(self.publish_data) self.assertTrue(self.provider.can_publish(self.e1)) self.p1.delete() self.assertFalse(self.provider.can_publish(self.e1))
def testGetDescriptionCustom(self): ph = PublishHandler(self.e1.id, create=True) self.publish_data[self.custom_description_key] = self.random_custom_description ph.update(self.publish_data) self.assertEquals(self.random_custom_description, ph.custom_description()) self.assertEquals(ph.custom_description(), self.random_custom_description) description = self.provider.get_description(self.e1) self.assertEquals(description, self.random_custom_description)
def testCanPublishPublicAndPublished(self): # (experiment public: True, access type: published) -> True self.e1.public = True ph = PublishHandler(self.e1.id, create=True) ph.update(self.publish_data) self.assertTrue(self.provider.can_publish(self.e1))
def testCanPublishNotPublicAndMediated(self): # (experiment public: False, access type: mediated) -> FALSE self.publish_data[self.access_type_key] = "mediated" ph = PublishHandler(self.e1.id, create=True) ph.update(self.publish_data) self.assertFalse(self.provider.can_publish(self.e1))
def testCanPublishNotPublicAndPublic(self): # (experiment public: False, access type: public) -> FALSE ph = PublishHandler(self.e1.id, create=True) ph.update(self.publish_data) self.assertFalse(self.provider.can_publish(self.e1))