[CMF-checkins] CVS: Products/CMFCore/tests -
test_ActionProviderBase.py:1.16.4.1
test_ActionsTool.py:1.16.4.1 test_DiscussionTool.py:1.5.12.1
test_WorkflowTool.py:1.9.12.1
Yvo Schubbe
y.2004_ at wcm-solutions.de
Wed Jul 21 11:47:42 EDT 2004
Update of /cvs-repository/Products/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv31550/CMFCore/tests
Modified Files:
Tag: yuppie-apb-redo-branch
test_ActionProviderBase.py test_ActionsTool.py
test_DiscussionTool.py test_WorkflowTool.py
Log Message:
- removed (never released) OldstyleActionProviderBase again:
ActionProviderBase now also works with oldstyle dicts
and action providers that still need an OAI have to call getOAI()
- added ActionInfo, a lazy custom dict class that replaces the old Action info mappings
- listActionInfos() and listFilteredActionsFor() now return ActionInfo objects
- removed duplicate filtering in listFilteredActionsFor():
it's now expensive and there should be no duplicates anyway
- made getMapping() faster
=== Products/CMFCore/tests/test_ActionProviderBase.py 1.16 => 1.16.4.1 ===
--- Products/CMFCore/tests/test_ActionProviderBase.py:1.16 Mon Jul 19 14:11:36 2004
+++ Products/CMFCore/tests/test_ActionProviderBase.py Wed Jul 21 11:47:12 2004
@@ -213,7 +213,7 @@
def test_listActionInfos(self):
wanted = [{'id': 'an_id', 'title': 'A Title', 'name': 'A Title',
'url': '', 'permissions': (), 'category': 'object',
- 'visible': False }]
+ 'visible': False, 'available': True, 'allowed': True}]
apb = self.site._setObject( 'portal_apb', self._makeProvider(1) )
rval = apb.listActionInfos()
@@ -234,7 +234,7 @@
def test_getActionInfo(self):
wanted = {'id': 'an_id', 'title': 'A Title', 'name': 'A Title',
'url': '', 'permissions': (), 'category': 'object',
- 'visible': False }
+ 'visible': False, 'available': True, 'allowed': True}
apb = self.site._setObject( 'portal_apb', self._makeProvider(1) )
rval = apb.getActionInfo( ('object/an_id',) )
=== Products/CMFCore/tests/test_ActionsTool.py 1.16 => 1.16.4.1 ===
--- Products/CMFCore/tests/test_ActionsTool.py:1.16 Mon Jul 19 14:11:36 2004
+++ Products/CMFCore/tests/test_ActionsTool.py Wed Jul 21 11:47:12 2004
@@ -69,36 +69,10 @@
'title': 'Folder contents',
'name': 'Folder contents',
'visible': True,
+ 'available': True,
+ 'allowed': True,
'category': 'folder'}],
'global': []})
-
- def test_DuplicateActions(self):
- """
- Check that listFilteredActionsFor
- filters out duplicate actions.
- """
- root = self.root
- tool = self.tool
- action = ActionInformation(id='test',
- title='Test',
- action=Expression(
- text='string: a_url'
- ),
- condition='',
- permissions=(),
- category='object',
- visible=1
- )
- tool._actions = [action,action]
- self.tool.action_providers = ('portal_actions',)
- self.assertEqual(tool.listFilteredActionsFor(root)['object'],
- [{'permissions': (),
- 'id': 'test',
- 'url': ' a_url',
- 'title': 'Test',
- 'name': 'Test',
- 'visible': True,
- 'category': 'object'}])
def test_interface(self):
from Products.CMFCore.interfaces.portal_actions \
=== Products/CMFCore/tests/test_DiscussionTool.py 1.5 => 1.5.12.1 ===
--- Products/CMFCore/tests/test_DiscussionTool.py:1.5 Mon Apr 26 08:14:17 2004
+++ Products/CMFCore/tests/test_DiscussionTool.py Wed Jul 21 11:47:12 2004
@@ -14,10 +14,10 @@
from Products.CMFCore.interfaces.portal_discussion \
import oldstyle_portal_discussion as IOldstyleDiscussionTool
from Products.CMFCore.interfaces.portal_actions \
- import OldstyleActionProvider as IOldstyleActionProvider
+ import ActionProvider as IActionProvider
verifyClass(IOldstyleDiscussionTool, DiscussionTool)
- verifyClass(IOldstyleActionProvider, DiscussionTool)
+ verifyClass(IActionProvider, DiscussionTool)
class OldDiscussableTests(TestCase):
=== Products/CMFCore/tests/test_WorkflowTool.py 1.9 => 1.9.12.1 ===
--- Products/CMFCore/tests/test_WorkflowTool.py:1.9 Mon Apr 26 08:14:17 2004
+++ Products/CMFCore/tests/test_WorkflowTool.py Wed Jul 21 11:47:12 2004
@@ -319,10 +319,10 @@
from Products.CMFCore.interfaces.portal_workflow \
import portal_workflow as IWorkflowTool
from Products.CMFCore.interfaces.portal_actions \
- import OldstyleActionProvider as IOldstyleActionProvider
+ import ActionProvider as IActionProvider
verifyClass(IWorkflowTool, WorkflowTool)
- verifyClass(IOldstyleActionProvider, WorkflowTool)
+ verifyClass(IActionProvider, WorkflowTool)
def test_suite():
More information about the CMF-checkins
mailing list