def setUp(self): BaseTestCase.setUp(self) self.login_as_portal_owner() api.user.create(username='******', email="*****@*****.**") api.user.create( username='******', email="*****@*****.**", roles=('Member', 'Contributor'))
def setUp(self): BaseTestCase.setUp(self) self.login_as_portal_owner() api.user.create(username='******', email="*****@*****.**") api.user.create(username='******', email="*****@*****.**") api.user.create(username='******', email="*****@*****.**") api.user.create(username='******', email="*****@*****.**") self.workspace_folder = api.content.create( self.workspace_container, 'ploneintranet.workspace.workspacefolder', 'example-workspace', title='Welcome to my workspace') # Allow the users to create testing content # This policy, will be then reset to fit the testcase self.workspace_folder.participant_policy = 'producers' self.add_user_to_workspace('wsmember', self.workspace_folder) self.add_user_to_workspace('wsowner', self.workspace_folder) self.add_user_to_workspace('wsadmin', self.workspace_folder, {'Admins'}) self.login('wsowner') self.folder_in_workspace = api.content.create(self.workspace_folder, 'Folder', 'owner-folder') self.login_as_portal_owner() # Finally change the workspace folder policy and (eventually) its state self.workspace_folder.participant_policy = self._participant_policy if self._fire_transition: api.content.transition(self.workspace_folder, self._fire_transition)
def setUp(self): BaseTestCase.setUp(self) self.login_as_portal_owner() api.user.create(username="******", email="*****@*****.**") api.user.create(username="******", email="*****@*****.**") api.user.create(username="******", email="*****@*****.**") self.workspace_folder = api.content.create( self.portal, "ploneintranet.workspace.workspacefolder", "example-workspace", title="Welcome to my workspace" ) self.add_user_to_workspace("wsmember", self.workspace_folder) self.add_user_to_workspace("wsadmin", self.workspace_folder, set(["Admins"])) self.document = api.content.create(self.workspace_folder, "Document", "document1")
def setUp(self): BaseTestCase.setUp(self) self.login_as_portal_owner() api.user.create(username='******', email="*****@*****.**") api.user.create(username='******', email="*****@*****.**") self.templates_container = self.portal.get(TEMPLATES_FOLDER) self.template = api.content.create( self.templates_container, 'ploneintranet.workspace.workspacefolder', 'example-template', title='Welcome to my workspace template') self.add_user_to_workspace('johndoe', self.template)
def setUp(self): BaseTestCase.setUp(self) self.login_as_portal_owner() self.workspace_container = api.content.create( self.portal, 'ploneintranet.workspace.workspacecontainer', 'notifications-workspace-container', title='Workspace container for testing email notifications') self.workspace = api.content.create( self.workspace_container, 'ploneintranet.workspace.workspacefolder', 'notifications-workspace-container', title='Workspace container for testing email notifications')
def setUp(self): BaseTestCase.setUp(self) self.login_as_portal_owner() self.open_workspaces = api.content.create( type="ploneintranet.workspace.workspacecontainer", title="Open Workspaces", container=self.portal, ) self.restricted_workspaces = api.content.create( type="ploneintranet.workspace.workspacecontainer", title="Restricted Workspaces", container=self.portal, ) api.content.transition(self.restricted_workspaces, 'restrict') api.user.create(username='******', email="*****@*****.**") api.user.create(username='******', email="*****@*****.**") api.user.grant_roles( username='******', obj=self.restricted_workspaces, roles=['Contributor'], ) api.user.create(username='******', email="*****@*****.**") api.user.create(username='******', email="*****@*****.**") api.user.create(username='******', email="*****@*****.**") self.workspace_container = api.content.create( self.portal, 'ploneintranet.workspace.workspacecontainer', 'example-workspace-container', title='Welcome to my example workspace container' ) self.workspace_folder = api.content.create( self.workspace_container, 'ploneintranet.workspace.workspacefolder', 'example-workspace', title='Welcome to my workspace' ) self.add_user_to_workspace('wsmember', self.workspace_folder) self.add_user_to_workspace('wsadmin', self.workspace_folder, set(['Admins'])) # A workspace editor api.user.create(username='******', email='*****@*****.**') self.add_user_to_workspace('wseditor', self.workspace_folder) # Grant them the Editor role on the workspace api.user.grant_roles( username='******', obj=self.workspace_folder, roles=['Editor'], )
def setUp(self): BaseTestCase.setUp(self) self.login_as_portal_owner() api.user.create(username='******', email="*****@*****.**") api.user.create(username='******', email="*****@*****.**") api.user.create(username='******', email="*****@*****.**") self.workspace_folder = api.content.create( self.portal, 'ploneintranet.workspace.workspacefolder', 'example-workspace', title='Welcome to my workspace') self.add_user_to_workspace('wsmember', self.workspace_folder) self.add_user_to_workspace('wsadmin', self.workspace_folder, set(['Admins']))
def setUp(self): BaseTestCase.setUp(self) self.login_as_portal_owner() self.open_workspaces = api.content.create( type="ploneintranet.workspace.workspacecontainer", title="Open Workspaces", container=self.portal, ) self.restricted_workspaces = api.content.create( type="ploneintranet.workspace.workspacecontainer", title="Restricted Workspaces", container=self.portal, ) api.content.transition(self.restricted_workspaces, 'restrict') api.user.create(username='******', email="*****@*****.**") api.user.create(username='******', email="*****@*****.**") api.user.grant_roles( username='******', obj=self.restricted_workspaces, roles=['Contributor'], ) api.user.create(username='******', email="*****@*****.**") api.user.create(username='******', email="*****@*****.**") api.user.create(username='******', email="*****@*****.**") self.workspace_container = api.content.create( self.portal, 'ploneintranet.workspace.workspacecontainer', 'example-workspace-container', title='Welcome to my example workspace container' ) self.workspace_folder = api.content.create( self.workspace_container, 'ploneintranet.workspace.workspacefolder', 'example-workspace', title='Welcome to my workspace' ) self.add_user_to_workspace('wsmember', self.workspace_folder) self.add_user_to_workspace('wsadmin', self.workspace_folder, set(['Admins']))
def setUp(self): BaseTestCase.setUp(self) self.login_as_portal_owner() api.user.create(username='******', email="*****@*****.**") api.user.create(username='******', email="*****@*****.**") api.user.create(username='******', email="*****@*****.**") self.workspace_folder = api.content.create( self.workspace_container, 'ploneintranet.workspace.case', 'example-case', title='Welcome to my case') self.add_user_to_workspace('wsmember', self.workspace_folder) self.add_user_to_workspace('wsadmin', self.workspace_folder, set(['Admins'])) self.document = api.content.create(self.workspace_folder, 'Document', 'document1') login(self.portal, 'wsmember') # wsmember is owner of document2 self.document2 = api.content.create(self.workspace_folder, 'Document', 'document2') self.login_as_portal_owner()