Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
CMFPlone.tests.testPloneFolder.TestManageDelObjects Class Reference
Inheritance diagram for CMFPlone.tests.testPloneFolder.TestManageDelObjects:
Inheritance graph
Collaboration diagram for CMFPlone.tests.testPloneFolder.TestManageDelObjects:
Collaboration graph

List of all members.

Public Member Functions

def afterSetUp
def testManageDelObjects
def testManageDelObjectsIfSub1Denied
def testManageDelObjectsIfSub2Denied
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes


Detailed Description

Definition at line 199 of file

Member Function Documentation

Definition at line 203 of file

00204     def afterSetUp(self):
00205         # Create a bunch of folders
00206         self.folder.invokeFactory('Folder', id='sub1')
00207         self.sub1 = self.folder.sub1
00208         self.sub1.invokeFactory('Folder', id='sub2')
00209         self.sub2 = self.sub1.sub2

Definition at line 30 of file

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,
) [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

00027     def setRequestMethod(self, method):
00028'REQUEST_METHOD', method)
00029 = method

Here is the caller graph for this function:

Definition at line 35 of file

00036     def setupAuthenticator(self):
00037         name, token = self.getAuthenticator()
00038[name] = token

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 210 of file

00211     def testManageDelObjects(self):
00212         # Should be able to delete sub1
00213         self.folder.manage_delObjects('sub1')
00214         self.failIf('sub1' in self.folder.objectIds())

Definition at line 215 of file

00216     def testManageDelObjectsIfSub1Denied(self):
00217         # Should NOT be able to delete sub1 due to permission checks in
00218         # Archetypes.BaseFolder.manage_delObjects().
00219         self.sub1.manage_permission(DeleteObjects, ['Manager'], acquire=0)
00220         self.assertRaises(Unauthorized, self.folder.manage_delObjects, 'sub1')

Definition at line 221 of file

00222     def testManageDelObjectsIfSub2Denied(self):
00223         # We are able to delete sub1 if sub2 is denied
00224         # -> the check is only 1 level deep!
00225         self.sub2.manage_permission(DeleteObjects, ['Manager'], acquire=0)
00226         self.folder.manage_delObjects('sub1')
00227         self.failIf('sub1' in self.folder.objectIds())

Member Data Documentation

Definition at line 206 of file

Definition at line 208 of file

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