def __init__(self): if hasattr(BaseTool, '__init__'): BaseTool.__init__(self) # build and persist an MD5 key self.md5key = '' for i in range(0, 20): self.md5key += chr(ord('a') + random.randint(0, 26))
def __init__(self): if hasattr(BaseTool, '__init__'): BaseTool.__init__(self) # build and persist an MD5 key self.md5key = '' for i in range(0, 20): self.md5key += chr(ord('a') + random.randint(0, 26))
def test_listActionInformationActions(self): """ Check that listFilteredActionsFor works for objects that return ActionInformation objects """ root = self.root tool = self.tool root._setObject('portal_registration', RegistrationTool()) self.tool.action_providers = ('portal_actions', ) self.assertEqual( tool.listFilteredActionsFor(root.portal_registration), { 'workflow': [], 'user': [], 'object': [], 'folder': [{ 'permissions': ('List folder contents', ), 'id': 'folderContents', 'url': 'http://foo/folder_contents', 'title': 'Folder contents', 'name': 'Folder contents', 'visible': True, 'available': True, 'allowed': True, 'category': 'folder' }], 'global': [] })
def _makeOne(self): from Products.CMFCore.RegistrationTool import RegistrationTool return RegistrationTool()