def setUpContent(self):
        pat.login(self.portal, testing.SITE_ADMIN)

        self.member = helpers.add_activated_cnrd_member(
            self.people, "Test User 1", "student", uid="test_user_1")

        self.c1 = helpers.create_challenge(
            self.challenges, "challenge_1", title="Challenge 1")
        self.c2 = helpers.create_challenge(
            self.challenges, "challenge_2", title="Challenge 2")

        self.ws1 = ws_helpers.create_workspace(
            self.workspaces, 'ws_1', title=u"Workspace 1",
            challenges=[RelationValue(self.c1.intid)])
        self.ws1.addMember(self.member.id)
        self.ws2 = ws_helpers.create_workspace(
            self.workspaces, 'ws_2', title=u"Workspace 2",
            challenges=[RelationValue(self.c2.intid)])
        self.ws2.addMember(self.member.id)

        self.project = helpers.create_project(
            self.workspaces, 'project',
            title=u"Prøjėçt",
            description=u"A lengthy but interesting description",
            goals=u"Lorem ipsum. Add goals here.")
        ws_helpers.do_action_for(self.project, 'publish')

        pat.logout()
    def setUpContent(self):
        pat.login(self.portal, testing.SITE_ADMIN)
        self.challenge = helpers.create_challenge(
            self.challenges, "a-real-challenge")
        self.ws_owner = helpers.add_activated_student(
            self.people, u"Owen Owner")
        self.ws_admin = helpers.add_activated_student(
            self.people, u"Hörbert M@ier")
        self.ws_member = helpers.add_activated_student(
            self.people, u"Mandy Membr")

        pat.login(self.portal, self.ws_owner.id)
        self.ws = ws_helpers.create_workspace(
            self.workspaces,
            "workspace",
            title=u"Workspace",
            description=u"A lengthy but interesting description",
            goals=u"Lorem ipsum. Add goals here.",
            challenges=[relatify(self.challenge)])
        ws_helpers.do_action_for(self.ws,
            'publish-for-site-members-with-public-decription')
        self.ws.addManager(self.ws_admin.id)
        self.ws.addMember(self.ws_member.id)

        pat.logout()
    def setUpContent(self):
        pat.login(self.portal, testing.SITE_ADMIN)

        self.ws = ws_helpers.create_workspace(
            self.workspaces,
            "workspace",
            title=u"Workspace",
            description=u"A lengthy but interesting description",
            goals=u"Lorem ipsum. Add goals here.")
        ws_helpers.do_action_for(self.ws,
            'publish-for-site-members-with-public-decription')

        self.links = []

        for i in range(1, 4):
            group_label = u"Group {0}".format(i)
            group_handle = add_group(self.ws, group_label)
            link_id = "link-{0}".format(i)
            link_title = u"Link {0}".format(i)
            self.ws.invokeFactory('RichLink', link_id, title=link_title,
                                  url="www.ixds.com", rmGroup=group_handle)
            self.links.append(self.ws[link_id])

        link_id = "link-without-group"
        self.ws.invokeFactory('RichLink', link_id, title="Link without Group",
                              url="www.ixds.com")
        self.misc_link = self.ws[link_id]
        self.links.append(self.misc_link)

        add_group(self.ws, u"Empty Group")

        pat.logout()
    def setUpContent(self):
        pat.login(self.portal, testing.SITE_ADMIN)

        self.challenge = helpers.create_challenge(
            self.challenges, "a-real-challenge")

        for i in range(0, 20):
            wsId = "workspace_" + str(i)
            wsName = u"Workspace " + str(i)
            ws = ws_helpers.create_workspace(self.workspaces,
                wsId, title=wsName,
                challenges=[relatify(self.challenge)])
            modified(ws)

        for i in range(0, 5):
            projectId = 'project_' + str(i)
            projectName = u"Prøjėçt " + str(i)
            project = helpers.create_project(
                self.workspaces, projectId,
                title=projectName,
                challenges=[relatify(self.challenge)],
                description=u"A lengthy but interesting description",
                goals=u"Lorem ipsum. Add goals here.")
            ws_helpers.do_action_for(project, 'publish')

            for j in range(0,3):
                wsId = "project_workspace_" + str(i) + "_" + str(j)
                wsName = u"Project-Workspace " + str(i) + " " + str(j)
                ws = ws_helpers.create_workspace(self.workspaces,
                    wsId, title=wsName)
                project.add_workspace(ws)

        pat.logout()
    def test_workspace_publishing(self):
        setRoles(self.portal, TEST_USER_ID, ('Manager',))

        ws_id = "workspace-1"
        self.portal.invokeFactory('ixds.Workspace', ws_id)
        ws = self.portal[ws_id]
        helpers.do_action_for(ws, "publish")

        # the ws should be published:
        pw = getToolByName(self.portal, 'portal_workflow')
        self.assertEqual(pw.getInfoFor(ws, 'review_state'), 'published')
    def setUpContent(self):
        pat.login(self.portal, testing.MANAGER)

        self.project = helpers.create_project(
            self.workspaces, 'project',
            title=u"Prøjėçt")
        ws_helpers.do_action_for(self.project, 'publish')
        self.ws = ws_helpers.create_workspace(self.workspaces,
            "project-workspace", title=u"Project Workspace")
        self.ws.addMember(testing.STUDENT)
        self.project.add_workspace(self.ws)

        pat.logout()
    def test_cnrd_workspace_creation(self):
        login(self.portal, testing.SITE_ADMIN)

        add_view = self.wss.restrictedTraverse("++add++ixds.Workspace")
        add_view.update()

        self.assertIn('workspace-draft', self.wss)

        workspace = self.wss['workspace-draft']
        workspace.title = "Test Workspace"
        utilities.rename(workspace)
        helpers.do_action_for(workspace, 'publish-for-site-members')

        self.assertIn('test-workspace', self.wss)
    def test_project_creation(self):
        login(self.portal, testing.SITE_ADMIN)

        workspaces = self.portal.restrictedTraverse("workspaces")

        add_view = workspaces.restrictedTraverse("++add++cnrd.Project")
        add_view.update()

        self.assertIn('project-draft', workspaces)

        project = workspaces['project-draft']
        project.title = "Test Project"
        utilities.rename(project)
        ws_helpers.do_action_for(project, 'publish-for-site-members')

        self.assertIn('test-project', workspaces)
Exemple #9
0
    def setUpPloneSite(self, portal):
        testing.login(portal, MANAGER)

        portal.invokeFactory(id=WSS, type_name='Folder')
        wss = helpers.do_action_for(portal[WSS], 'publish')
        ws_creators = ['Member', 'Site Administrator', 'Manager']
        wss.manage_permission('IxdsWorkspace: Add Workspace', ws_creators)
        wss.manage_permission('Add portal content', ws_creators)
        wss.setLocallyAllowedTypes(['ixds.Workspace'])
        wss.setImmediatelyAddableTypes(['ixds.Workspace'])

        testing.login(portal, WS_OWNER)

        for oid in TRANSITIONS:
            wss.invokeFactory('ixds.Workspace', oid, title=u"%s" % oid)
            ws = wss[oid]
            if TRANSITIONS[oid]:
                ws = helpers.do_action_for(ws, TRANSITIONS[oid])
            ws.addMember(WS_MEMBER)
            modified(ws)

        testing.logout()
    def setUpContent(self):
        pat.login(self.portal, testing.MANAGER)

        self.project = helpers.create_project(
            self.workspaces, 'project',
            title=u"Prøjėçt",
            description=u"A lengthy but interesting description",
            goals=u"Lorem ipsum. Add goals here.")
        ws_helpers.do_action_for(self.project, 'publish')
        self.ws = ws_helpers.create_workspace(self.workspaces,
            "project-workspace", title=u"Project Workspace")
        self.project.add_workspace(self.ws)

        self.post_text = richtextify(
            u"<p>" + 40*u"<a href="">Rich</a> Text " + u"</p>")
        self.project.invokeFactory(
            'ixds.Post', "post-in-project", project_featured=True,
            title="Post in project",
            text=self.post_text)
        self.project_post = self.project["post-in-project"]
        self.ws.invokeFactory(
            'ixds.Post', "post-in-workspace", project_featured=True,
            title="Post in workspace",
            text=self.post_text)
        self.workspace_post = self.ws["post-in-workspace"]

        self.ws.invokeFactory(
            'ixds.Post', "local-ws-post", project_featured=False,
            title="Local WS-Post",
            text=self.post_text)
        self.local_workspace_post = self.ws["local-ws-post"]

        self.project_post.invokeFactory(
            'ixds.Reply', "reply-in-project",
            title="Reply in project",
            text=self.post_text)

        pat.logout()
    def setUpContent(self):
        pat.login(self.portal, testing.TEACHER)
        self.ws = ws_helpers.create_workspace(self.workspaces,
            "project_workspace", title=u"Project-Workspace")

        pat.login(self.portal, testing.SITE_ADMIN)
        self.challenge = helpers.create_challenge(
            self.challenges, "a-real-challenge")
        self.project = helpers.create_project(
            self.workspaces, 'project',
            title=u"Prøjėçt",
            description=u"A lengthy but interesting description",
            goals=u"Lorem ipsum. Add goals here.")
        ws_helpers.do_action_for(self.project, 'publish')
        self.project_admin = helpers.add_activated_student(
            self.people, u"Hörbert M@ier")
        self.project.addManager(self.project_admin.id)
        self.project.add_workspace(self.ws)
        self.project_member = helpers.add_activated_student(
            self.people, u"Memberus Projectis")
        self.ws.addMember(self.project_member.id)

        pat.logout()
Exemple #12
0
def create_project(folder, id, **kwargs):
    folder.invokeFactory('cnrd.Project', id, **kwargs)
    project = folder[id]
    ws_helpers.do_action_for(project, 'publish-for-site-members')
    return project