Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Private Member Functions
CMFCore.tests.test_ActionsTool.ActionsToolSecurityRequestTests Class Reference
Inheritance diagram for CMFCore.tests.test_ActionsTool.ActionsToolSecurityRequestTests:
Inheritance graph
[legend]
Collaboration diagram for CMFCore.tests.test_ActionsTool.ActionsToolSecurityRequestTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setUp
def test_listActionInformationActions
def tearDown

Public Attributes

 tool

Private Member Functions

def _getTargetClass
def _makeOne

Detailed Description

Definition at line 100 of file test_ActionsTool.py.


Member Function Documentation

Definition at line 102 of file test_ActionsTool.py.

00102 
00103     def _getTargetClass(self):
00104         from Products.CMFCore.ActionsTool import ActionsTool
00105 
00106         return ActionsTool

Definition at line 107 of file test_ActionsTool.py.

00107 
00108     def _makeOne(self, *args, **kw):
00109         return self._getTargetClass()(*args, **kw)

Here is the call graph for this function:

Definition at line 110 of file test_ActionsTool.py.

00110 
00111     def setUp(self):
00112         SecurityRequestTest.setUp(self)
00113 
00114         root = self.root
00115         sm = getSiteManager()
00116         sm.registerUtility(root, ISiteRoot)
00117         root._setObject( 'portal_actions', self._makeOne() )
00118         root._setObject( 'portal_url', URLTool() )
00119         root._setObject( 'foo', URLTool() )
00120         root._setObject('portal_membership', MembershipTool())
00121         self.tool = root.portal_actions
00122         self.tool.action_providers = ('portal_actions',)

Here is the call graph for this function:

Definition at line 154 of file test_ActionsTool.py.

00154 
00155     def tearDown(self):
00156         cleanUp()
00157         SecurityRequestTest.tearDown(self)
00158 

Here is the call graph for this function:

Definition at line 123 of file test_ActionsTool.py.

00123 
00124     def test_listActionInformationActions(self):
00125         # Check that listFilteredActionsFor works for objects that return
00126         # ActionInformation objects
00127         root = self.root
00128         tool = self.tool
00129         tool._actions = (
00130               ActionInformation(id='folderContents',
00131                                 title='Folder contents',
00132                                 action=Expression(text='string:'
00133                                              '${folder_url}/folder_contents'),
00134                                 condition=Expression(text='python: '
00135                                                       'folder is not object'),
00136                                 permissions=('List folder contents',),
00137                                 category='folder',
00138                                 visible=1)
00139             ,
00140             )
00141         self.assertEqual(tool.listFilteredActionsFor(root.foo),
00142                          {'workflow': [],
00143                           'user': [],
00144                           'object': [],
00145                           'folder': [{'id': 'folderContents',
00146                                       'url': 'http://nohost/folder_contents',
00147                                       'title': 'Folder contents',
00148                                       'description': '',
00149                                       'visible': True,
00150                                       'available': True,
00151                                       'allowed': True,
00152                                       'category': 'folder'}],
00153                           'global': []})


Member Data Documentation

Definition at line 120 of file test_ActionsTool.py.


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