Back to index

plone3  3.1.7
Classes | Functions | Variables
GroupUserFolder.tests.testPloneTools Namespace Reference

Classes

class  GroupTestCase
class  TestGroupsTool
class  TestGroupDataTool
class  TestGroupData
class  TestMethodProtection

Functions

def test_addGroup
 grps = searchForGroups(name = "toto")
def test_editGroup
def test_removeGroups
def test_setGroupOwnership
def test_setGroupWorkspacesFolder
def test_getGroupWorkspacesFolderId
def test_getGroupWorkspacesFolder
def test_toggleGroupWorkspacesCreation
def test_getGroupWorkspacesCreationFlag
def test_getGroupWorkspaceType
def test_setGroupWorkspaceType
def test_createGrouparea
def test_getGroupareaFolder
def test_getGroupareaURL
def test_suite

Variables

string __version__ = "$Revision: $"
 GroupUserFolder Copyright (C)2006 Ingeniweb.
string __docformat__ = 'restructuredtext'
tuple app = ZopeTestCase.app()

Function Documentation

grps = searchForGroups(name = "toto")

Create a group with the supplied id, roles, and domains.

Underlying user folder must support adding users via the usual Zope API.
Passwords for groups seem to be currently irrelevant in GRUF.

Definition at line 166 of file testPloneTools.py.

00166 
00167     def test_addGroup(self, ):
00168         """Create a group with the supplied id, roles, and domains.
00169 
00170         Underlying user folder must support adding users via the usual Zope API.
00171         Passwords for groups seem to be currently irrelevant in GRUF."""
00172         # Create a sample group
00173         self.groups.addGroup("grptest1",)
00174         self.failUnless("grptest1" in self.groups.listGroupIds())
00175 
00176         # Re-create that group to ensure it's forbidden
00177         self.failUnlessRaises(ValueError, self.groups.addGroup, "grptest1")
00178 
00179         # Create group with additional roles, groups and properties (if possible)
00180         self.groups.addGroup("grptest2", ["Reviewer", ], ["grptest1", ], description = "Sample group")
00181         g = self.groups.getGroupById("grptest2")
00182         g1 = self.groups.getGroupById("grptest1")
00183         self.failUnlessEqual(g.getProperty("description"), "Sample group")
00184         self.failUnless("grptest2" in g1.getGroupMemberIds(), g1.getGroupMemberIds(), )
00185         self.failUnless(self.gruf.getGroupByName("grptest2").has_role("Reviewer"))

Here is the call graph for this function:

Create a space in the portal for the given group, much like member home
folders.

Definition at line 259 of file testPloneTools.py.

00259 
00260     def test_createGrouparea(self, ):
00261         """Create a space in the portal for the given group, much like member home
00262         folders."""

Edit the given group with the supplied password, roles, and domains.

Underlying user folder must support editing users via the usual Zope API.
Passwords for groups seem to be currently irrelevant in GRUF.

Definition at line 186 of file testPloneTools.py.

00186 
00187     def test_editGroup(self, ):
00188         """Edit the given group with the supplied password, roles, and domains.
00189 
00190         Underlying user folder must support editing users via the usual Zope API.
00191         Passwords for groups seem to be currently irrelevant in GRUF."""
00192         # Edit a group with additional roles, groups and properties (if possible)
00193         self.groups.addGroup("grptest1",)
00194         self.groups.addGroup("grptest2",)
00195         self.groups.editGroup("grptest2", ["Reviewer", ], ["grptest1", ], description = "Sample group")
00196         g = self.groups.getGroupById("grptest2")
00197         g1 = self.groups.getGroupById("grptest1")
00198         self.failUnlessEqual(g.getProperty("description"), "Sample group")
00199         self.failUnless("group_grptest2" in g1.getGroup().getMemberIds(), g1.getGroup().getMemberIds(), )
00200         self.failUnless("grptest2" in g1.getGroupMemberIds(), g1.getGroupMemberIds(), )
00201         self.failUnless(self.gruf.getGroupByName("grptest2").has_role("Reviewer"))
00202 
00203         # Try to edit an invalid group
00204         self.failUnlessRaises(ValueError, self.groups.editGroup, "grptest_toto")

Here is the call graph for this function:

Returns the object of the group's work area.

Definition at line 263 of file testPloneTools.py.

00263 
00264     def test_getGroupareaFolder(self, ):
00265         """Returns the object of the group's work area."""

Returns the full URL to the group's work area.

Definition at line 266 of file testPloneTools.py.

00266 
00267     def test_getGroupareaURL(self, ):
00268         """Returns the full URL to the group's work area."""
00269 
    
Return the (boolean) flag indicating whether the Groups Tool will create a group workspace
upon the next use of the group (if one doesn't exist). 

Definition at line 249 of file testPloneTools.py.

00249 
00250     def test_getGroupWorkspacesCreationFlag(self, ):
00251         """Return the (boolean) flag indicating whether the Groups Tool will create a group workspace
00252         upon the next use of the group (if one doesn't exist). """

Get the Group Workspaces folder object.

The Group Workspaces Folder contains all the group workspaces, just like the
Members folder contains all the member folders. 

Definition at line 239 of file testPloneTools.py.

00239 
00240     def test_getGroupWorkspacesFolder(self, ):
00241         """ Get the Group Workspaces folder object.
00242 
00243         The Group Workspaces Folder contains all the group workspaces, just like the
00244         Members folder contains all the member folders. """

Get the Group Workspaces folder object's id.

The Group Workspaces Folder contains all the group workspaces, just like the
Members folder contains all the member folders. 

Definition at line 233 of file testPloneTools.py.

00233 
00234     def test_getGroupWorkspacesFolderId(self, ):
00235         """ Get the Group Workspaces folder object's id.
00236 
00237         The Group Workspaces Folder contains all the group workspaces, just like the
00238         Members folder contains all the member folders. """

Return the Type (as in TypesTool) to make the GroupWorkspace.

Definition at line 253 of file testPloneTools.py.

00253 
00254     def test_getGroupWorkspaceType(self, ):
00255         """Return the Type (as in TypesTool) to make the GroupWorkspace."""

Remove the group in the provided list (if possible).

Will by default remove this group's GroupWorkspace if it exists. You may
turn this off by specifying keep_workspaces=true.
Underlying user folder must support removing users via the usual Zope API.

Definition at line 205 of file testPloneTools.py.

00205 
00206     def test_removeGroups(self, ):
00207         """Remove the group in the provided list (if possible).
00208 
00209         Will by default remove this group's GroupWorkspace if it exists. You may
00210         turn this off by specifying keep_workspaces=true.
00211         Underlying user folder must support removing users via the usual Zope API."""
00212         self.groups.addGroup("grptest1",)
00213         self.groups.addGroup("grptest2",)
00214         self.groups.editGroup("grptest2", ["Reviewer", ], ["grptest1", ], description = "Sample group")
00215         self.groups.removeGroups(["grptest1", "grptest2", ])
00216         self.failIf("grptest2" in self.groups.listGroupIds())
00217         self.failIf("grptest1" in self.groups.listGroupIds())
00218         self.failIf("grptest2" in self.gruf.getGroupNames())
00219         self.failIf("grptest1" in self.gruf.getGroupNames())

Make the object 'object' owned by group 'group' (a portal_groupdata-ish object)

Definition at line 220 of file testPloneTools.py.

00220 
00221     def test_setGroupOwnership(self, ):
00222         """Make the object 'object' owned by group 'group' (a portal_groupdata-ish object)"""

Set the location of the Group Workspaces folder by id.

The Group Workspaces Folder contains all the group workspaces, just like the
Members folder contains all the member folders.

If anyone really cares, we can probably make the id work as a path as well,
but for the moment it's only an id for a folder in the portal root, just like the
corresponding MembershipTool functionality. 

Definition at line 223 of file testPloneTools.py.

00223 
00224     def test_setGroupWorkspacesFolder(self, ):
00225         """ Set the location of the Group Workspaces folder by id.
00226 
00227         The Group Workspaces Folder contains all the group workspaces, just like the
00228         Members folder contains all the member folders.
00229 
00230         If anyone really cares, we can probably make the id work as a path as well,
00231         but for the moment it's only an id for a folder in the portal root, just like the
00232         corresponding MembershipTool functionality. """

Set the Type (as in TypesTool) to make the GroupWorkspace. Expects the name of a Type.

Definition at line 256 of file testPloneTools.py.

00256 
00257     def test_setGroupWorkspaceType(self, ):
00258         """Set the Type (as in TypesTool) to make the GroupWorkspace. Expects the name of a Type."""

Definition at line 513 of file testPloneTools.py.

00513 
00514     def test_suite():
00515         suite = unittest.TestSuite()
00516         suite.addTest(unittest.makeSuite(TestGroupsTool))
00517         suite.addTest(unittest.makeSuite(TestGroupDataTool))
00518         suite.addTest(unittest.makeSuite(TestGroupData))
00519         suite.addTest(unittest.makeSuite(TestMethodProtection))
00520         return suite
00521 
Toggles the flag for creation of a GroupWorkspaces folder upon first
use of the group. 

Definition at line 245 of file testPloneTools.py.

00245 
00246     def test_toggleGroupWorkspacesCreation(self, ):
00247         """ Toggles the flag for creation of a GroupWorkspaces folder upon first
00248         use of the group. """


Variable Documentation

Definition at line 24 of file testPloneTools.py.

GroupUserFolder Copyright (C)2006 Ingeniweb.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

Definition at line 21 of file testPloneTools.py.

tuple GroupUserFolder.tests.testPloneTools.app = ZopeTestCase.app()

Definition at line 47 of file testPloneTools.py.