Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def test_doAddUser
def test_doAddUser_WithGroups
def test_doChangeUser
def test_doChangeUser_WithGroups
def test_doDelUsers
def testUserFolderAddUser
def testUserFolderAddUser_WithGroups
def testUserFolderEditUser
def testUserFolderEditUser_WithGroups
def testUserFolderDelUsers
def test_updateUser_Groups
def beforeTearDown
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 uf

Detailed Description

Definition at line 115 of file testGroupUserFolder.py.


Member Function Documentation

Definition at line 117 of file testGroupUserFolder.py.

00117 
00118     def afterSetUp(self):
00119         self.uf = self.portal.acl_users
00120         self._trap_warning_output()
00121 
00122         if 'auto_group' in self.uf.objectIds():
00123             self.uf.manage_delObjects(['auto_group'])
00124         self.uf.userFolderAddGroup(default_group, [])
00125         self.uf.userSetGroups(default_user, groupnames=[default_group])

Definition at line 207 of file testGroupUserFolder.py.

00207 
00208     def beforeTearDown(self):
00209         self._free_warning_output()
00210 

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 128 of file testGroupUserFolder.py.

00128 
00129     def test_doAddUser(self):
00130         self.uf._doAddUser('user2', 'secret', ['Member'], [])
00131         user = self.uf.getUser('user2')
00132         self.assertEqual(tuple(user.getRoles()), ('Member', 'Authenticated'))
00133         self.assertEqual(user.getGroups(), [])  # XXX: Should be tuple
00134         self.assertEqual(user.getGroupIds(), [])
00135         self.assertEqual(user.getGroupNames(), [])

Definition at line 136 of file testGroupUserFolder.py.

00136 
00137     def test_doAddUser_WithGroups(self):
00138         self.uf._doAddUser('user2', 'secret', ['Member'], [], [default_group])
00139         user = self.uf.getUser('user2')
00140         self.assertEqual(tuple(user.getRoles()), ('Member', 'Authenticated'))
00141         self.assertEqual(user.getGroups(), [PREFIX+default_group])  # XXX: WTF?
00142         self.assertEqual(user.getGroupIds(), [PREFIX+default_group])
00143         self.assertEqual(user.getGroupNames(), [default_group])

Definition at line 144 of file testGroupUserFolder.py.

00144 
00145     def test_doChangeUser(self):
00146         self.uf._doChangeUser(default_user, None, ['Reviewer'], [])
00147         user = self.uf.getUser(default_user)
00148         self.assertEqual(tuple(user.getRoles()), ('Reviewer', 'Authenticated'))
00149         self.assertEqual(user.getGroups(), [PREFIX+default_group])

Definition at line 150 of file testGroupUserFolder.py.

00150 
00151     def test_doChangeUser_WithGroups(self):
00152         self.uf.userFolderAddGroup('group2', [])
00153         self.uf._doChangeUser(default_user, None, ['Reviewer'], [], ['group2'])
00154 
00155         user = self.uf.getUser(default_user)
00156         self.assertEqual(tuple(user.getRoles()), ('Reviewer', 'Authenticated'))
00157         self.assertEqual(user.getGroups(), [PREFIX+'group2'])

Definition at line 158 of file testGroupUserFolder.py.

00158 
00159     def test_doDelUsers(self):
00160         self.uf._doDelUsers([default_user])
00161         self.failUnless(self.uf.getUser(default_user) is None)

Definition at line 200 of file testGroupUserFolder.py.

00200 
00201     def test_updateUser_Groups(self):
00202         self.uf.userFolderAddGroup('group2', [])
00203         self.uf.userSetGroups(default_user, groupnames=['group2'])
00204         user = self.uf.getUser(default_user)
00205         self.assertEqual(tuple(user.getRoles()), ('Member', 'Authenticated'))
00206         self.assertEqual(user.getGroups(), [PREFIX+'group2'])

Definition at line 165 of file testGroupUserFolder.py.

00165 
00166     def testUserFolderAddUser(self):
00167         self.uf.userFolderAddUser('user2', 'secret', ['Member'], [])
00168         user = self.uf.getUser('user2')
00169         self.assertEqual(tuple(user.getRoles()), ('Member', 'Authenticated'))
00170         self.assertEqual(user.getGroups(), [])
00171         self.assertEqual(user.getGroupIds(), [])
00172         self.assertEqual(user.getGroupNames(), [])

Definition at line 173 of file testGroupUserFolder.py.

00173 
00174     def testUserFolderAddUser_WithGroups(self):
00175         self.uf.userFolderAddUser('user2', 'secret', ['Member'], [], [default_group])
00176         user = self.uf.getUser('user2')
00177         self.assertEqual(tuple(user.getRoles()), ('Member', 'Authenticated'))
00178         self.assertEqual(user.getGroups(), [PREFIX+default_group])
00179         self.assertEqual(user.getGroupIds(), [PREFIX+default_group])
00180         self.assertEqual(user.getGroupNames(), [default_group])

Definition at line 194 of file testGroupUserFolder.py.

00194 
00195     def testUserFolderDelUsers(self):
00196         self.uf.userFolderDelUsers([default_user])
00197         self.failUnless(self.uf.getUser(default_user) is None)

Definition at line 181 of file testGroupUserFolder.py.

00181 
00182     def testUserFolderEditUser(self):
00183         self.uf.userFolderEditUser(default_user, None, ['Reviewer'], [])
00184         user = self.uf.getUser(default_user)
00185         self.assertEqual(tuple(user.getRoles()), ('Reviewer', 'Authenticated'))
00186         self.assertEqual(user.getGroups(), [PREFIX+default_group])

Definition at line 187 of file testGroupUserFolder.py.

00187 
00188     def testUserFolderEditUser_WithGroups(self):
00189         self.uf.userFolderAddGroup('group2', [])
00190         self.uf.userFolderEditUser(default_user, None, ['Reviewer'], [], ['group2'])
00191         user = self.uf.getUser(default_user)
00192         self.assertEqual(tuple(user.getRoles()), ('Reviewer', 'Authenticated'))
00193         self.assertEqual(user.getGroups(), [PREFIX+'group2'])


Member Data Documentation

Definition at line 118 of file testGroupUserFolder.py.


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