Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testGetUser
def testGetBadUser
def testGetUserById
def testGetBadUserById
def testGetGroup
def testGetBadGroup
def testGetGroupById
def testGetBadGroupById
def testGetGroupByName
def testGetBadGroupByName
def testGetUsers
def testGetUserIds
def testGetUserNames
def testGetGroups
def testGetGroupIds
def testGetGroupNames
def beforeTearDown
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 uf

Detailed Description

Definition at line 18 of file testGroupUserFolder.py.


Member Function Documentation

Definition at line 20 of file testGroupUserFolder.py.

00020 
00021     def afterSetUp(self):
00022         self.uf = self.portal.acl_users
00023         self._trap_warning_output()
00024         
00025         if 'auto_group' in self.uf.objectIds():
00026             self.uf.manage_delObjects(['auto_group'])
00027 
00028         # Nuke Administators and Reviewers groups added in 2.1a2 migrations
00029         # (and any other migrated-in groups) to avoid test confusion
00030         self.portal.portal_groups.removeGroups(self.portal.portal_groups.listGroupIds())
00031         
00032         self.uf.userFolderAddGroup(default_group, [])
00033         self.uf.userSetGroups(default_user, groupnames=[default_group])

Definition at line 111 of file testGroupUserFolder.py.

00111 
00112     def beforeTearDown(self):
00113         self._free_warning_output()
00114 

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

00049 
00050     def testGetBadGroup(self):
00051         self.assertEqual(self.uf.getGroup('group2'), None)

Definition at line 55 of file testGroupUserFolder.py.

00055 
00056     def testGetBadGroupById(self):
00057         self.assertEqual(self.uf.getGroupById('group2'), None)

Definition at line 61 of file testGroupUserFolder.py.

00061 
00062     def testGetBadGroupByName(self):
00063         self.assertEqual(self.uf.getGroupByName('group2'), None)

Definition at line 37 of file testGroupUserFolder.py.

00037 
00038     def testGetBadUser(self):
00039         self.assertEqual(self.uf.getUser('user2'), None)

Definition at line 43 of file testGroupUserFolder.py.

00043 
00044     def testGetBadUserById(self):
00045         self.assertEqual(self.uf.getUserById('user2'), None)

Definition at line 46 of file testGroupUserFolder.py.

00046 
00047     def testGetGroup(self):
00048         self.failIfEqual(self.uf.getGroup(default_group), None)

Definition at line 52 of file testGroupUserFolder.py.

00052 
00053     def testGetGroupById(self):
00054         self.failIfEqual(self.uf.getGroupById(PREFIX+default_group), None)

Definition at line 58 of file testGroupUserFolder.py.

00058 
00059     def testGetGroupByName(self):
00060         self.failIfEqual(self.uf.getGroupByName(default_group), None)

Definition at line 97 of file testGroupUserFolder.py.

00097 
00098     def testGetGroupIds(self):
00099         # Returns group ids
00100         groupids = self.uf.getGroupIds()
00101         self.failUnless(groupids)
00102         self.assertEqual(len(groupids), 1)
00103         self.failUnless(PREFIX+default_group in groupids)

Definition at line 104 of file testGroupUserFolder.py.

00104 
00105     def testGetGroupNames(self):
00106         # Returns group names
00107         groupnames = self.uf.getGroupNames()
00108         self.failUnless(groupnames)
00109         self.assertEqual(len(groupnames), 1)
00110         self.failUnless(default_group in groupnames)

Definition at line 89 of file testGroupUserFolder.py.

00089 
00090     def testGetGroups(self):
00091         # Returns groups
00092         groups = self.uf.getGroups()
00093         self.failUnless(groups)
00094         self.assertEqual(len(groups), 1)
00095         groupids = [x.getId() for x in groups]
00096         self.failUnless(PREFIX+default_group in groupids)

Definition at line 34 of file testGroupUserFolder.py.

00034 
00035     def testGetUser(self):
00036         self.failIfEqual(self.uf.getUser(default_user), None)

Definition at line 40 of file testGroupUserFolder.py.

00040 
00041     def testGetUserById(self):
00042         self.failIfEqual(self.uf.getUserById(default_user), None)

Definition at line 73 of file testGroupUserFolder.py.

00073 
00074     def testGetUserIds(self):
00075         # Returns user and group ids
00076         userids = self.uf.getUserIds()
00077         self.failUnless(userids)
00078         self.assertEqual(len(userids), 1)
00079         self.failUnless(default_user in userids)
00080         self.failIf(PREFIX+default_group in userids)

Definition at line 81 of file testGroupUserFolder.py.

00081 
00082     def testGetUserNames(self):
00083         # Returns user and group names
00084         usernames = self.uf.getUserNames()
00085         self.failUnless(usernames)
00086         self.assertEqual(len(usernames), 1)
00087         self.failUnless(default_user in usernames)
00088         self.failIf(default_group in usernames)

Definition at line 64 of file testGroupUserFolder.py.

00064 
00065     def testGetUsers(self):
00066         # Returns users and groups
00067         users = self.uf.getUsers()
00068         self.failUnless(users)
00069         self.assertEqual(len(users), 1)
00070         userids = [x.getId() for x in users]
00071         self.failUnless(default_user in userids)
00072         self.failIf(PREFIX+default_group in userids)


Member Data Documentation

Definition at line 21 of file testGroupUserFolder.py.


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