Ejemplo n.º 1
0
    def test_poll_publishing(self):
        setRoles(self.portal, TEST_USER_ID, ('Manager',))
        workspaces = self.portal.restrictedTraverse("workspaces")
        ws = helpers.create_workspace(workspaces, 'ws1', title=u"Workspace 1")
        p = helpers.create_poll(ws, 'p1', title=u"Poll 1")
        fileuploadcapable.publish_post(p)

        # polls are renamed when published:
        self.assertTrue('poll-1' in ws)
        self.assertEqual(p, ws['poll-1'])
Ejemplo n.º 2
0
    def test_post_publishing(self):
        login(self.portal, testing.SITE_ADMIN)

        fileuploadcapable.publish_post(self.post)

        # posts are renamed when published:
        expected_post_id = 'toast-post'

        self.assertTrue(expected_post_id in self.ws)
        self.assertEqual(self.ws[expected_post_id], self.post)