Commit b1b8a205 authored by 's avatar

- converted one more tool

parent 4f787f3c
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
# #
############################################################################## ##############################################################################
""" Web-configurable workflow. """ Web-configurable workflow.
$Id$
""" """
from AccessControl.SecurityInfo import ClassSecurityInfo from AccessControl.SecurityInfo import ClassSecurityInfo
...@@ -28,7 +26,6 @@ from zope.event import notify ...@@ -28,7 +26,6 @@ from zope.event import notify
from zope.interface import implements from zope.interface import implements
from Products.CMFCore.interfaces import IWorkflowDefinition from Products.CMFCore.interfaces import IWorkflowDefinition
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.WorkflowCore import ObjectDeleted from Products.CMFCore.WorkflowCore import ObjectDeleted
from Products.CMFCore.WorkflowCore import ObjectMoved from Products.CMFCore.WorkflowCore import ObjectMoved
from Products.CMFCore.WorkflowCore import WorkflowException from Products.CMFCore.WorkflowCore import WorkflowException
......
...@@ -23,6 +23,7 @@ from zope.component import getSiteManager ...@@ -23,6 +23,7 @@ from zope.component import getSiteManager
from zope.component import provideHandler from zope.component import provideHandler
from zope.interface.verify import verifyClass from zope.interface.verify import verifyClass
from Products.CMFCore.interfaces import ITypesTool
from Products.CMFCore.interfaces import IWorkflowTool from Products.CMFCore.interfaces import IWorkflowTool
from Products.CMFCore.testing import TraversingEventZCMLLayer from Products.CMFCore.testing import TraversingEventZCMLLayer
from Products.CMFCore.tests.base.dummy import DummyContent from Products.CMFCore.tests.base.dummy import DummyContent
...@@ -43,12 +44,13 @@ class DCWorkflowDefinitionTests(SecurityTest): ...@@ -43,12 +44,13 @@ class DCWorkflowDefinitionTests(SecurityTest):
SecurityTest.setUp(self) SecurityTest.setUp(self)
self.app._setObject('site', DummySite('site')) self.app._setObject('site', DummySite('site'))
self.site = self.app._getOb('site') self.site = self.app._getOb('site')
self.site._setObject('portal_types', DummyTool())
self.wtool = self.site._setObject('portal_workflow', WorkflowTool()) self.wtool = self.site._setObject('portal_workflow', WorkflowTool())
getSiteManager().registerUtility(self.wtool, IWorkflowTool)
self._constructDummyWorkflow() self._constructDummyWorkflow()
transaction.savepoint(optimistic=True) transaction.savepoint(optimistic=True)
newSecurityManager(None, OmnipotentUser().__of__(self.site)) newSecurityManager(None, OmnipotentUser().__of__(self.site))
sm = getSiteManager()
sm.registerUtility(self.wtool, IWorkflowTool)
sm.registerUtility(DummyTool(), ITypesTool)
def test_interfaces(self): def test_interfaces(self):
from Products.CMFCore.interfaces import IWorkflowDefinition from Products.CMFCore.interfaces import IWorkflowDefinition
......
...@@ -20,6 +20,7 @@ from AccessControl import getSecurityManager ...@@ -20,6 +20,7 @@ from AccessControl import getSecurityManager
from zope.component import getSiteManager from zope.component import getSiteManager
from zope.testing.cleanup import cleanUp from zope.testing.cleanup import cleanUp
from Products.CMFCore.interfaces import ITypesTool
from Products.CMFCore.interfaces import IWorkflowTool from Products.CMFCore.interfaces import IWorkflowTool
from Products.CMFCore.tests.base.dummy import DummyContent from Products.CMFCore.tests.base.dummy import DummyContent
from Products.CMFCore.tests.base.dummy import DummySite from Products.CMFCore.tests.base.dummy import DummySite
...@@ -33,13 +34,14 @@ class TestGuard(unittest.TestCase): ...@@ -33,13 +34,14 @@ class TestGuard(unittest.TestCase):
def setUp(self): def setUp(self):
self.site = DummySite('site') self.site = DummySite('site')
self.site._setObject('portal_types', DummyTool())
# Construct a workflow # Construct a workflow
self.wtool = WorkflowTool() self.wtool = WorkflowTool()
self.wtool._setObject('wf', DCWorkflowDefinition('wf')) self.wtool._setObject('wf', DCWorkflowDefinition('wf'))
self.wtool.setDefaultChain('wf') self.wtool.setDefaultChain('wf')
getSiteManager().registerUtility(self.wtool, IWorkflowTool) sm = getSiteManager()
sm.registerUtility(self.wtool, IWorkflowTool)
sm.registerUtility(DummyTool(), ITypesTool)
def tearDown(self): def tearDown(self):
cleanUp() cleanUp()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment