Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
CMFPlone.tests.testGroupUserFolder.TestUsersAndGroups Class Reference
Inheritance diagram for CMFPlone.tests.testGroupUserFolder.TestUsersAndGroups:
Inheritance graph
[legend]
Collaboration diagram for CMFPlone.tests.testGroupUserFolder.TestUsersAndGroups:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testUserGetId
def testUserGetName
def testUserGetRoles
def testUserGetGroups
def testUserGetGroupNames
def testGroupGetId
def testGroupGetName
def testGroupGetRoles
def testGroupGetGroups
def testGroupGetGroupNames
def testGroupGetMembers
def testGroupGetMemberIds
def beforeTearDown
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 uf
 user
 group

Detailed Description

Definition at line 267 of file testGroupUserFolder.py.


Member Function Documentation

Definition at line 269 of file testGroupUserFolder.py.

00269 
00270     def afterSetUp(self):
00271         self.uf = self.portal.acl_users
00272         self._trap_warning_output()
00273 
00274         self.uf.userFolderAddGroup(default_group, [])
00275         if 'auto_group' in self.uf.objectIds():
00276             self.uf.manage_delObjects(['auto_group'])
00277         self.uf.userSetGroups(default_user, groupnames=[default_group])
00278 
00279         self.user = self.uf.getUser(default_user)
00280         self.group = self.uf.getGroup(default_group)

Definition at line 326 of file testGroupUserFolder.py.

00326 
00327     def beforeTearDown(self):
00328         self._free_warning_output()
00329 

Here is the call graph for this function:

Definition at line 30 of file PloneTestCase.py.

00030 
00031     def getAuthenticator(self):
00032         tag = AuthenticatorView('context', 'request').authenticator()
00033         pattern = '<input .*name="(\w+)".*value="(\w+)"'
00034         return match(pattern, tag).groups()

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.tests.PloneTestCase.PloneTestCase.setRequestMethod (   self,
  method 
) [inherited]
This is a stub now, but in case you want to try
   something fancy on Your Branch (tm), put it here.

Definition at line 26 of file PloneTestCase.py.

00026 
00027     def setRequestMethod(self, method):
00028         self.app.REQUEST.set('REQUEST_METHOD', method)
00029         self.app.REQUEST.method = method

Here is the caller graph for this function:

Definition at line 35 of file PloneTestCase.py.

00035 
00036     def setupAuthenticator(self):
00037         name, token = self.getAuthenticator()
00038         self.app.REQUEST.form[name] = token
00039 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 316 of file testGroupUserFolder.py.

00316 
00317     def testGroupGetGroupNames(self):
00318         self.assertEqual(self.group.getGroupNames(), []) # XXX: Should be tuple

Definition at line 313 of file testGroupUserFolder.py.

00313 
00314     def testGroupGetGroups(self):
00315         self.assertEqual(self.group.getGroups(), []) # XXX: Should be tuple

Definition at line 302 of file testGroupUserFolder.py.

00302 
00303     def testGroupGetId(self):
00304         self.assertEqual(self.group.getId(), PREFIX+default_group)

Definition at line 323 of file testGroupUserFolder.py.

00323 
00324     def testGroupGetMemberIds(self):
00325         self.assertEqual(list(self.group.getMemberIds()), [default_user])

Definition at line 319 of file testGroupUserFolder.py.

00319 
00320     def testGroupGetMembers(self):
00321         # XXX: No getMembers! GroupData-wrapper provides getGroupMembers.
00322         pass

Definition at line 305 of file testGroupUserFolder.py.

00305 
00306     def testGroupGetName(self):
00307         # XXX: Bah! Why no getGroupName? Only available on GroupData-wrapped members!
00308         #self.assertEqual(self.group.getGroupName(), default_group)
00309         self.assertEqual(self.group.getName(), default_group)

Definition at line 310 of file testGroupUserFolder.py.

00310 
00311     def testGroupGetRoles(self):
00312         self.assertEqual(tuple(self.group.getRoles()), ('Authenticated',))

Definition at line 297 of file testGroupUserFolder.py.

00297 
00298     def testUserGetGroupNames(self):
00299         self.assertEqual(self.user.getGroupNames(), [default_group]) # XXX: Should be tuple

Definition at line 292 of file testGroupUserFolder.py.

00292 
00293     def testUserGetGroups(self):
00294         # XXX: This should return a tuple!
00295         # Also note that it returns group ids, i.e. including the prefix
00296         self.assertEqual(self.user.getGroups(), [PREFIX+default_group])

Definition at line 283 of file testGroupUserFolder.py.

00283 
00284     def testUserGetId(self):
00285         self.assertEqual(self.user.getId(), default_user)

Definition at line 286 of file testGroupUserFolder.py.

00286 
00287     def testUserGetName(self):
00288         self.assertEqual(self.user.getUserName(), default_user)

Definition at line 289 of file testGroupUserFolder.py.

00289 
00290     def testUserGetRoles(self):
00291         self.assertEqual(tuple(self.user.getRoles()), ('Member', 'Authenticated'))


Member Data Documentation

Definition at line 279 of file testGroupUserFolder.py.

Definition at line 270 of file testGroupUserFolder.py.

Definition at line 278 of file testGroupUserFolder.py.


The documentation for this class was generated from the following file: