[CMF-checkins] SVN: CMF/branches/2.1/ - backported r77003 from trunk
Yvo Schubbe
y.2007- at wcm-solutions.de
Sun Jun 24 04:58:04 EDT 2007
Log message for revision 77004:
- backported r77003 from trunk
- cleanup and fix for r76996
Changed:
U CMF/branches/2.1/CMFCalendar/CalendarTool.py
U CMF/branches/2.1/CMFCore/CMFCatalogAware.py
U CMF/branches/2.1/CMFCore/CatalogTool.py
U CMF/branches/2.1/CMFCore/ContentTypeRegistry.py
U CMF/branches/2.1/CMFCore/DiscussionTool.py
U CMF/branches/2.1/CMFCore/MembershipTool.py
U CMF/branches/2.1/CMFCore/SkinsTool.py
U CMF/branches/2.1/CMFCore/WorkflowTool.py
U CMF/branches/2.1/CMFCore/exportimport/catalog.py
U CMF/branches/2.1/CMFCore/exportimport/content.py
U CMF/branches/2.1/CMFCore/exportimport/cookieauth.py
U CMF/branches/2.1/CMFCore/exportimport/tests/test_actions.py
U CMF/branches/2.1/CMFCore/exportimport/tests/test_cookieauth.py
U CMF/branches/2.1/CMFCore/exportimport/tests/test_typeinfo.py
U CMF/branches/2.1/CMFCore/interfaces/_tools.py
U CMF/branches/2.1/CMFCore/tests/test_ActionsTool.py
U CMF/branches/2.1/CMFCore/tests/test_CachingPolicyManager.py
U CMF/branches/2.1/CMFCore/tests/test_DynamicType.py
U CMF/branches/2.1/CMFCore/tests/test_FSReSTMethod.py
U CMF/branches/2.1/CMFCore/tests/test_FSSTXMethod.py
U CMF/branches/2.1/CMFCore/tests/test_MemberDataTool.py
U CMF/branches/2.1/CMFCore/tests/test_MembershipTool.py
U CMF/branches/2.1/CMFCore/tests/test_OpaqueItems.py
U CMF/branches/2.1/CMFCore/tests/test_PortalContent.py
U CMF/branches/2.1/CMFCore/tests/test_PortalFolder.py
U CMF/branches/2.1/CMFCore/tests/test_SkinsTool.py
U CMF/branches/2.1/CMFCore/tests/test_WorkflowTool.py
U CMF/branches/2.1/CMFDefault/DefaultWorkflow.py
U CMF/branches/2.1/CMFDefault/DiscussionTool.py
U CMF/branches/2.1/CMFDefault/MetadataTool.py
U CMF/branches/2.1/CMFDefault/RegistrationTool.py
U CMF/branches/2.1/CMFDefault/skins/zpt_control/change_password.py
U CMF/branches/2.1/CMFDefault/tests/test_MembershipTool.py
U CMF/branches/2.1/CMFDefault/tests/test_MetadataTool.py
U CMF/branches/2.1/CMFDefault/tests/test_SyndicationTool.py
U CMF/branches/2.1/CMFUid/UniqueIdAnnotationTool.py
U CMF/branches/2.1/CMFUid/tests/test_uidannotation.py
U CMF/branches/2.1/CMFUid/tests/test_uidhandling.py
U CMF/branches/2.1/DCWorkflow/DCWorkflow.py
U CMF/branches/2.1/DCWorkflow/tests/test_exportimport.py
-=-
Modified: CMF/branches/2.1/CMFCalendar/CalendarTool.py
===================================================================
--- CMF/branches/2.1/CMFCalendar/CalendarTool.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCalendar/CalendarTool.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -25,7 +25,6 @@
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from Products.CMFCore.utils import getToolByName
-from Products.CMFCore.utils import registerToolInterface
from Products.CMFCore.utils import UniqueObject
from interfaces import ICalendarTool
Modified: CMF/branches/2.1/CMFCore/CMFCatalogAware.py
===================================================================
--- CMF/branches/2.1/CMFCore/CMFCatalogAware.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/CMFCatalogAware.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -24,11 +24,13 @@
from Globals import InitializeClass
from OFS.interfaces import IObjectClonedEvent
from OFS.interfaces import IObjectWillBeMovedEvent
-
from zope.app.container.interfaces import IObjectAddedEvent
from zope.app.container.interfaces import IObjectMovedEvent
from zope.component import subscribers
+from interfaces import ICallableOpaqueItem
+from interfaces.IOpaqueItems \
+ import ICallableOpaqueItem as z2ICallableOpaqueItem
from permissions import AccessContentsInformation
from permissions import ManagePortal
from permissions import ModifyPortalContent
@@ -36,13 +38,6 @@
from utils import _getAuthenticatedUser
from utils import getToolByName
-from interfaces import ICallableOpaqueItem
-from interfaces import ICatalogTool
-from interfaces import IConfigurableWorkflowTool
-from interfaces.IOpaqueItems \
- import ICallableOpaqueItem as z2ICallableOpaqueItem
-
-
logger = logging.getLogger('CMFCore.CMFCatalogAware')
Modified: CMF/branches/2.1/CMFCore/CatalogTool.py
===================================================================
--- CMF/branches/2.1/CMFCore/CatalogTool.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/CatalogTool.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -24,8 +24,6 @@
from Globals import InitializeClass
from Products.PluginIndexes.common import safe_callable
from Products.ZCatalog.ZCatalog import ZCatalog
-
-from zope.component import queryUtility
from zope.interface import implements
from zope.interface import providedBy
from zope.interface.declarations import getObjectSpecification
@@ -35,7 +33,6 @@
from ActionProviderBase import ActionProviderBase
from interfaces import ICatalogTool
from interfaces import IIndexableObjectWrapper
-from interfaces import IConfigurableWorkflowTool
from interfaces.portal_catalog \
import IndexableObjectWrapper as z2IIndexableObjectWrapper
from interfaces.portal_catalog import portal_catalog as z2ICatalogTool
Modified: CMF/branches/2.1/CMFCore/ContentTypeRegistry.py
===================================================================
--- CMF/branches/2.1/CMFCore/ContentTypeRegistry.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/ContentTypeRegistry.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -22,14 +22,11 @@
from Globals import InitializeClass
from Globals import PersistentMapping
from OFS.SimpleItem import SimpleItem
+from zope.interface import implements
from ZPublisher.mapply import mapply
-from zope.component import getUtility
-from zope.interface import implements
-
from interfaces import IContentTypeRegistry
from interfaces import IContentTypeRegistryPredicate
-from interfaces import ITypesTool
from interfaces.ContentTypeRegistry \
import ContentTypeRegistry as z2IContentTypeRegistry
from interfaces.ContentTypeRegistry \
@@ -40,6 +37,7 @@
class MajorMinorPredicate( SimpleItem ):
+
"""
Predicate matching on 'major/minor' content types.
Empty major or minor implies wildcard (all match).
@@ -127,7 +125,9 @@
InitializeClass( MajorMinorPredicate )
+
class ExtensionPredicate( SimpleItem ):
+
"""
Predicate matching on filename extensions.
"""
@@ -190,7 +190,9 @@
InitializeClass( ExtensionPredicate )
+
class MimeTypeRegexPredicate( SimpleItem ):
+
"""
Predicate matching only on 'typ', using regex matching for
string patterns (other objects conforming to 'match' can
@@ -247,7 +249,9 @@
InitializeClass( MimeTypeRegexPredicate )
+
class NameRegexPredicate( SimpleItem ):
+
"""
Predicate matching only on 'name', using regex matching
for string patterns (other objects conforming to 'match'
@@ -325,6 +329,7 @@
class ContentTypeRegistry( SimpleItem ):
+
"""
Registry for rules which map PUT args to a CMF Type Object.
"""
Modified: CMF/branches/2.1/CMFCore/DiscussionTool.py
===================================================================
--- CMF/branches/2.1/CMFCore/DiscussionTool.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/DiscussionTool.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -15,33 +15,35 @@
$Id$
"""
+import urllib
+
+from AccessControl import ClassSecurityInfo
+from Acquisition import Implicit
+from DateTime.DateTime import DateTime
+from Globals import DTMLFile
+from Globals import InitializeClass
from OFS.SimpleItem import SimpleItem
-from Globals import InitializeClass, DTMLFile
-from Acquisition import Implicit
-from AccessControl import ClassSecurityInfo
-
from zope.component import getUtility
from zope.interface import implements
from ActionProviderBase import ActionProviderBase
-from permissions import AccessContentsInformation
-from permissions import ManagePortal
-from permissions import ReplyToItem
-from permissions import View
-from interfaces import ICatalogTool
from interfaces import IMembershipTool
from interfaces import IOldstyleDiscussable
from interfaces import IOldstyleDiscussionTool
-from interfaces import ITypesTool
from interfaces.Discussions import OldDiscussable as z2IOldstyleDiscussable
from interfaces.portal_discussion \
import oldstyle_portal_discussion as z2IOldstyleDiscussionTool
+from permissions import AccessContentsInformation
+from permissions import ManagePortal
+from permissions import ReplyToItem
+from permissions import View
from utils import _dtmldir
from utils import getToolByName
from utils import UniqueObject
class OldDiscussable(Implicit):
+
"""
Adapter for PortalContent to implement "old-style" discussions.
"""
@@ -50,7 +52,6 @@
__implements__ = z2IOldstyleDiscussable
security = ClassSecurityInfo()
-
def __init__( self, content ):
self.content = content
@@ -132,7 +133,7 @@
security = ClassSecurityInfo()
manage_options = ( { 'label' : 'Overview', 'action' : 'manage_overview' }
- ,
+ ,
) + SimpleItem.manage_options
#
Modified: CMF/branches/2.1/CMFCore/MembershipTool.py
===================================================================
--- CMF/branches/2.1/CMFCore/MembershipTool.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/MembershipTool.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -27,7 +27,6 @@
from Globals import PersistentMapping
from OFS.Folder import Folder
from ZODB.POSException import ConflictError
-
from zope.component import getUtility
from zope.component import queryUtility
from zope.interface import implements
@@ -324,13 +323,16 @@
return _checkPermission(permissionName, object)
security.declarePublic('credentialsChanged')
- def credentialsChanged(self, password):
+ def credentialsChanged(self, password, REQUEST=None):
'''
Notifies the authentication mechanism that this user has changed
passwords. This can be used to update the authentication cookie.
Note that this call should *not* cause any change at all to user
databases.
'''
+ if REQUEST is None:
+ raise TypeError('new REQUEST argument required')
+
if not self.isAnonymousUser():
acl_users = self.acl_users
user = _getAuthenticatedUser(self)
@@ -341,8 +343,7 @@
# Use an interface provided by LoginManager.
acl_users.credentialsChanged(user, name, password)
else:
- req = self.REQUEST
- p = getattr(req, '_credentials_changed_path', None)
+ p = getattr(REQUEST, '_credentials_changed_path', None)
if p is not None:
# Use an interface provided by CookieCrumbler.
change = self.restrictedTraverse(p)
Modified: CMF/branches/2.1/CMFCore/SkinsTool.py
===================================================================
--- CMF/branches/2.1/CMFCore/SkinsTool.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/SkinsTool.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -27,7 +27,6 @@
from OFS.ObjectManager import REPLACEABLE
from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate
from Products.PythonScripts.PythonScript import PythonScript
-
from zope.component import getUtility
from zope.interface import implements
@@ -37,7 +36,6 @@
from DirectoryView import ignore_re
from interfaces import IMembershipTool
from interfaces import ISkinsTool
-from interfaces import IURLTool
from interfaces.portal_skins import portal_skins as z2ISkinsTool
from permissions import AccessContentsInformation
from permissions import ManagePortal
@@ -47,7 +45,6 @@
from utils import getToolByName
from utils import UniqueObject
-
def modifiedOptions():
# Remove the existing "Properties" option and add our own.
rval = []
@@ -379,4 +376,3 @@
self.default_skin = skinname
InitializeClass(SkinsTool)
-
Modified: CMF/branches/2.1/CMFCore/WorkflowTool.py
===================================================================
--- CMF/branches/2.1/CMFCore/WorkflowTool.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/WorkflowTool.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -25,10 +25,8 @@
from Globals import PersistentMapping
from OFS.Folder import Folder
from OFS.ObjectManager import IFAwareObjectManager
-
-from zope.component import queryUtility
-from zope.interface import implements
from zope.event import notify
+from zope.interface import implements
from ActionProviderBase import ActionProviderBase
from interfaces import IConfigurableWorkflowTool
@@ -41,12 +39,12 @@
from utils import Message as _
from utils import UniqueObject
from utils import postonly
+from WorkflowCore import ActionRaisedExceptionEvent
+from WorkflowCore import ActionSucceededEvent
+from WorkflowCore import ActionWillBeInvokedEvent
from WorkflowCore import ObjectDeleted
from WorkflowCore import ObjectMoved
from WorkflowCore import WorkflowException
-from WorkflowCore import ActionWillBeInvokedEvent
-from WorkflowCore import ActionRaisedExceptionEvent
-from WorkflowCore import ActionSucceededEvent
_marker = [] # Create a new marker object.
@@ -645,4 +643,3 @@
ob.reindexObjectSecurity()
InitializeClass(WorkflowTool)
-
Modified: CMF/branches/2.1/CMFCore/exportimport/catalog.py
===================================================================
--- CMF/branches/2.1/CMFCore/exportimport/catalog.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/exportimport/catalog.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -19,8 +19,6 @@
from Products.GenericSetup.utils import importObjects
from Products.CMFCore.utils import getToolByName
-from zope.component import getUtility
-from zope.component import queryUtility
def importCatalogTool(context):
Modified: CMF/branches/2.1/CMFCore/exportimport/content.py
===================================================================
--- CMF/branches/2.1/CMFCore/exportimport/content.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/exportimport/content.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -16,13 +16,11 @@
"""
from csv import reader
-from csv import register_dialect
from csv import writer
from ConfigParser import ConfigParser
from StringIO import StringIO
from zope.interface import implements
-from zope.interface import directlyProvides
from Products.GenericSetup.interfaces import IFilesystemExporter
from Products.GenericSetup.interfaces import IFilesystemImporter
Modified: CMF/branches/2.1/CMFCore/exportimport/cookieauth.py
===================================================================
--- CMF/branches/2.1/CMFCore/exportimport/cookieauth.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/exportimport/cookieauth.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -16,9 +16,6 @@
"""
from zope.component import adapts
-from zope.component import getSiteManager
-from zope.component import getUtility
-from zope.component import queryUtility
from Products.GenericSetup.interfaces import ISetupEnviron
from Products.GenericSetup.utils import exportObjects
Modified: CMF/branches/2.1/CMFCore/exportimport/tests/test_actions.py
===================================================================
--- CMF/branches/2.1/CMFCore/exportimport/tests/test_actions.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/exportimport/tests/test_actions.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -18,11 +18,9 @@
import unittest
import Testing
-from Acquisition import Implicit
from Acquisition import aq_parent
+from Acquisition import Implicit
from OFS.OrderedFolder import OrderedFolder
-
-from zope.component import getSiteManager
from zope.interface import implements
from zope.interface import Interface
@@ -30,6 +28,7 @@
from Products.CMFCore.interfaces import IActionsTool
from Products.CMFCore.interfaces.portal_actions \
import ActionProvider as IActionProvider
+from Products.CMFCore.testing import ExportImportZCMLLayer
from Products.CMFCore.tests.base.dummy import DummySite
from Products.GenericSetup.testing import BodyAdapterTestCase
from Products.GenericSetup.testing import NodeAdapterTestCase
@@ -37,8 +36,6 @@
from Products.GenericSetup.tests.common import DummyExportContext
from Products.GenericSetup.tests.common import DummyImportContext
-from Products.CMFCore.testing import ExportImportZCMLLayer
-
_ACTION_XML = """\
<object name="foo_action" meta_type="CMF Action">
<property name="title">Foo</property>
Modified: CMF/branches/2.1/CMFCore/exportimport/tests/test_cookieauth.py
===================================================================
--- CMF/branches/2.1/CMFCore/exportimport/tests/test_cookieauth.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/exportimport/tests/test_cookieauth.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -88,8 +88,6 @@
return CookieCrumblerXMLAdapter
def setUp(self):
- from Products.CMFCore.CookieCrumbler import CookieCrumbler
-
BodyAdapterTestCase.setUp(self)
self._obj = CookieCrumbler('foo_cookiecrumbler')
self._BODY = _COOKIECRUMBLER_BODY
Modified: CMF/branches/2.1/CMFCore/exportimport/tests/test_typeinfo.py
===================================================================
--- CMF/branches/2.1/CMFCore/exportimport/tests/test_typeinfo.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/exportimport/tests/test_typeinfo.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -288,8 +288,6 @@
self.assertEqual(obj._actions[0].condition.text, 'python:1')
def setUp(self):
- from Products.CMFCore.TypesTool import FactoryTypeInformation
-
BodyAdapterTestCase.setUp(self)
self._obj = FactoryTypeInformation('foo_fti')
self._BODY = _FTI_BODY
@@ -306,13 +304,9 @@
return TypesToolXMLAdapter
def _populate(self, obj):
- from Products.CMFCore.TypesTool import FactoryTypeInformation
-
obj._setObject('foo_type', FactoryTypeInformation('foo_type'))
def setUp(self):
- from Products.CMFCore.TypesTool import TypesTool
-
BodyAdapterTestCase.setUp(self)
self._obj = TypesTool()
self._BODY = _TYPESTOOL_BODY
Modified: CMF/branches/2.1/CMFCore/interfaces/_tools.py
===================================================================
--- CMF/branches/2.1/CMFCore/interfaces/_tools.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/interfaces/_tools.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -683,7 +683,7 @@
o Permission: Public
"""
- def credentialsChanged(password):
+ def credentialsChanged(password, REQUEST=None):
""" Notify the authentication mechanism that this user has
changed passwords.
Modified: CMF/branches/2.1/CMFCore/tests/test_ActionsTool.py
===================================================================
--- CMF/branches/2.1/CMFCore/tests/test_ActionsTool.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/tests/test_ActionsTool.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -25,11 +25,11 @@
from Products.CMFCore.ActionInformation import ActionCategory
from Products.CMFCore.ActionInformation import ActionInformation
from Products.CMFCore.Expression import Expression
+from Products.CMFCore.interfaces import IMembershipTool
+from Products.CMFCore.interfaces import ISiteRoot
from Products.CMFCore.MembershipTool import MembershipTool
from Products.CMFCore.tests.base.testcase import SecurityRequestTest
from Products.CMFCore.URLTool import URLTool
-from Products.CMFCore.interfaces import IMembershipTool
-from Products.CMFCore.interfaces import ISiteRoot
class ActionsToolTests(unittest.TestCase):
Modified: CMF/branches/2.1/CMFCore/tests/test_CachingPolicyManager.py
===================================================================
--- CMF/branches/2.1/CMFCore/tests/test_CachingPolicyManager.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/tests/test_CachingPolicyManager.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -29,17 +29,16 @@
from OFS.Cache import Cacheable
from zope.component import getSiteManager
-from Products.CMFCore.FSPageTemplate import FSPageTemplate
from Products.CMFCore.FSDTMLMethod import FSDTMLMethod
+from Products.CMFCore.FSPageTemplate import FSPageTemplate
+from Products.CMFCore.interfaces import ICachingPolicyManager
from Products.CMFCore.testing import FunctionalZCMLLayer
from Products.CMFCore.testing import TraversingZCMLLayer
from Products.CMFCore.tests.base.dummy import DummyContent
from Products.CMFCore.tests.base.dummy import DummySite
from Products.CMFCore.tests.base.dummy import DummyTool
-from Products.CMFCore.tests.base.dummy import DummyUserFolder
from Products.CMFCore.tests.base.testcase import FSDVTest
from Products.CMFCore.tests.base.testcase import RequestTest
-from Products.CMFCore.interfaces import ICachingPolicyManager
ACCLARK = DateTime( '2001/01/01' )
portal_owner = 'portal_owner'
@@ -84,13 +83,13 @@
# from a "FileCacheManager"
return result
- self.ZCacheable_set(None)
+ self.ZCacheable_set(None)
class DummyView(CacheableDummyContent):
meta_type = 'DTML Method'
-
+
class CachingPolicyTests(unittest.TestCase):
layer = TraversingZCMLLayer
@@ -1132,7 +1131,7 @@
headers = [x.lower() for x in self.RESPONSE.headers.keys()]
self.failIf('x-cache-headers-set-by' in headers)
self.failIf('vary' in headers)
-
+
def test_fireForSubtemplates2(self):
# This is a FSPageTemplate that will be used as the View for
# our content objects. It doesn't matter what it returns.
@@ -1215,8 +1214,8 @@
self.assertEquals( headers.get('cache-control')
, 'max-age=100, s-maxage=100'
)
-
+
class OFSCacheTests(RequestTest):
layer = FunctionalZCMLLayer
@@ -1250,7 +1249,7 @@
enable_304s = 0)
def test_empty(self):
-
+
from Products.CMFCore.CachingPolicyManager import CPMCache
cpm = self.portal.caching_policy_manager
Modified: CMF/branches/2.1/CMFCore/tests/test_DynamicType.py
===================================================================
--- CMF/branches/2.1/CMFCore/tests/test_DynamicType.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/tests/test_DynamicType.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -34,7 +34,6 @@
from Products.CMFCore.DynamicType import DynamicType
from Products.CMFCore.interfaces import IMembershipTool
-from Products.CMFCore.interfaces import ITypesTool
from Products.CMFCore.interfaces import ISiteRoot
from Products.CMFCore.tests.base.dummy import DummyObject
from Products.CMFCore.tests.base.dummy import DummySite
@@ -72,6 +71,7 @@
def test_z3interfaces(self):
from zope.interface.verify import verifyClass
from Products.CMFCore.interfaces import IDynamicType
+
verifyClass(IDynamicType, DynamicType)
Modified: CMF/branches/2.1/CMFCore/tests/test_FSReSTMethod.py
===================================================================
--- CMF/branches/2.1/CMFCore/tests/test_FSReSTMethod.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/tests/test_FSReSTMethod.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -134,7 +134,6 @@
from webdav.common import rfc1123_date
from Products.CMFCore.tests.base.dummy \
import DummyCachingManagerWithPolicy
- from Products.CMFCore.tests.base.dummy import DummyContent
mod_time = DateTime()
self.root.caching_policy_manager = DummyCachingManagerWithPolicy()
Modified: CMF/branches/2.1/CMFCore/tests/test_FSSTXMethod.py
===================================================================
--- CMF/branches/2.1/CMFCore/tests/test_FSSTXMethod.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/tests/test_FSSTXMethod.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -164,7 +164,6 @@
from webdav.common import rfc1123_date
from Products.CMFCore.tests.base.dummy \
import DummyCachingManagerWithPolicy
- from Products.CMFCore.tests.base.dummy import DummyContent
mod_time = DateTime()
self.root.caching_policy_manager = DummyCachingManagerWithPolicy()
Modified: CMF/branches/2.1/CMFCore/tests/test_MemberDataTool.py
===================================================================
--- CMF/branches/2.1/CMFCore/tests/test_MemberDataTool.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/tests/test_MemberDataTool.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -19,7 +19,6 @@
import Testing
import Acquisition
-
from zope.component import getSiteManager
from zope.testing.cleanup import cleanUp
Modified: CMF/branches/2.1/CMFCore/tests/test_MembershipTool.py
===================================================================
--- CMF/branches/2.1/CMFCore/tests/test_MembershipTool.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/tests/test_MembershipTool.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -20,16 +20,14 @@
from AccessControl.SecurityManagement import newSecurityManager
from OFS.Folder import Folder
-
from zope.component import getSiteManager
from zope.testing.cleanup import cleanUp
from Products.CMFCore.CMFBTreeFolder import CMFBTreeFolder
-from Products.CMFCore.MemberDataTool import MemberDataTool
-from Products.CMFCore.PortalFolder import PortalFolder
from Products.CMFCore.interfaces import IMemberDataTool
from Products.CMFCore.interfaces import ISiteRoot
-from Products.CMFCore.interfaces import IURLTool
+from Products.CMFCore.MemberDataTool import MemberDataTool
+from Products.CMFCore.PortalFolder import PortalFolder
from Products.CMFCore.tests.base.dummy import DummySite
from Products.CMFCore.tests.base.dummy import DummyTool
from Products.CMFCore.tests.base.dummy import DummyUserFolder
Modified: CMF/branches/2.1/CMFCore/tests/test_OpaqueItems.py
===================================================================
--- CMF/branches/2.1/CMFCore/tests/test_OpaqueItems.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/tests/test_OpaqueItems.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -99,8 +99,10 @@
class Marker(OpaqueBase):
+
""" Opaque item without manage_after/before hookes but marked as callable
"""
+
implements(ICallableOpaqueItem)
__implements__ = (
z2ICallableOpaqueItem,
@@ -108,8 +110,10 @@
class Hooks(OpaqueBase):
+
""" Opaque item with manage_after/before hooks but not marked as callable
"""
+
implements(ICallableOpaqueItemEvents)
__implements__ = (
z2ICallableOpaqueItemEvents,
@@ -129,6 +133,7 @@
class MarkerAndHooks(Marker, Hooks):
+
""" Opaque item with manage_after/before hookes and marked as callable
"""
__implements__ = Marker.__implements__ + Hooks.__implements__
Modified: CMF/branches/2.1/CMFCore/tests/test_PortalContent.py
===================================================================
--- CMF/branches/2.1/CMFCore/tests/test_PortalContent.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/tests/test_PortalContent.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -21,8 +21,6 @@
from AccessControl.SecurityManagement import newSecurityManager
from Acquisition import aq_base
from OFS.Folder import Folder
-
-from zope.component import getSiteManager
from zope.testing.cleanup import cleanUp
from Products.CMFCore.exceptions import NotFound
Modified: CMF/branches/2.1/CMFCore/tests/test_PortalFolder.py
===================================================================
--- CMF/branches/2.1/CMFCore/tests/test_PortalFolder.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/tests/test_PortalFolder.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -19,14 +19,13 @@
import Testing
import transaction
-from AccessControl.SecurityManagement import newSecurityManager
from AccessControl import SecurityManager
from AccessControl import Unauthorized
+from AccessControl.SecurityManagement import newSecurityManager
from Acquisition import aq_base
from Acquisition import Implicit
from DateTime import DateTime
from OFS.Image import manage_addFile
-
from zope.component import getSiteManager
from zope.component.interfaces import IFactory
from zope.interface import implements
Modified: CMF/branches/2.1/CMFCore/tests/test_SkinsTool.py
===================================================================
--- CMF/branches/2.1/CMFCore/tests/test_SkinsTool.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/tests/test_SkinsTool.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -49,21 +49,26 @@
def test_z2interfaces(self):
from Interface.Verify import verifyClass
+ from Products.CMFCore.interfaces.portal_actions \
+ import ActionProvider as IActionProvider
from Products.CMFCore.interfaces.portal_skins \
import portal_skins as ISkinsTool
from Products.CMFCore.interfaces.portal_skins \
import SkinsContainer as ISkinsContainer
from Products.CMFCore.SkinsTool import SkinsTool
+ verifyClass(IActionProvider, SkinsTool)
verifyClass(ISkinsContainer, SkinsTool)
verifyClass(ISkinsTool, SkinsTool)
def test_z3interfaces(self):
from zope.interface.verify import verifyClass
+ from Products.CMFCore.interfaces import IActionProvider
from Products.CMFCore.interfaces import ISkinsContainer
from Products.CMFCore.interfaces import ISkinsTool
from Products.CMFCore.SkinsTool import SkinsTool
+ verifyClass(IActionProvider, SkinsTool)
verifyClass(ISkinsContainer, SkinsTool)
verifyClass(ISkinsTool, SkinsTool)
@@ -97,10 +102,13 @@
tool = SkinsTool()
# This is needed otherwise REQUEST is the string
# '<Special Object Used to Force Acquisition>'
- REQUEST = None
-
+ REQUEST = None
+ def getSkinsFolderName(self):
+ '''tool'''
+ return 'tool'
+
return TestSkinnableObjectManager()
-
+
def tearDown(self):
from Products.CMFCore.Skinnable import SKINDATA
SKINDATA.clear()
@@ -114,17 +122,15 @@
som.tool.addSkinSelection('skinA', pathA)
som.tool.addSkinSelection('skinB', pathB)
-
+
som.tool.manage_properties(default_skin='skinA')
- # XXX For some reason these tests don't work.
-
# Expect the default skin name to be returned
- # self.failUnless(som.getCurrentSkinName() == 'skinA')
+ self.failUnless(som.getCurrentSkinName() == 'skinA')
# after a changeSkin the new skin name should be returned
- # som.changeSkin('skinB', som.REQUEST)
- # self.failUnless(som.getCurrentSkinName() == 'skinB')
+ som.changeSkin('skinB', som.REQUEST)
+ self.failUnless(som.getCurrentSkinName() == 'skinB')
def test_suite():
Modified: CMF/branches/2.1/CMFCore/tests/test_WorkflowTool.py
===================================================================
--- CMF/branches/2.1/CMFCore/tests/test_WorkflowTool.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFCore/tests/test_WorkflowTool.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -19,13 +19,14 @@
import Testing
from OFS.SimpleItem import SimpleItem
-
from zope.component import adapter
from zope.component import provideHandler
from zope.interface import implements
-from Products.CMFCore.interfaces import IActionWillBeInvokedEvent
+from zope.testing.cleanup import cleanUp
+
from Products.CMFCore.interfaces import IActionRaisedExceptionEvent
from Products.CMFCore.interfaces import IActionSucceededEvent
+from Products.CMFCore.interfaces import IActionWillBeInvokedEvent
from Products.CMFCore.interfaces import IContentish
from Products.CMFCore.interfaces import IWorkflowDefinition
@@ -111,7 +112,7 @@
@adapter(IActionWillBeInvokedEvent)
def notifyBeforeHandler(evt):
evt.workflow.notified( 'before-evt' ).append( (evt.object, evt.action) )
-
+
@adapter(IActionSucceededEvent)
def notifySuccessHandler(evt):
evt.workflow.notified( 'success-evt' ).append( (evt.object, evt.action,
@@ -182,6 +183,9 @@
tool.setChainForPortalTypes( ( 'Dummy Content', ), ( 'a', 'b' ) )
return tool
+ def tearDown(self):
+ cleanUp()
+
def test_z2interfaces(self):
from Interface.Verify import verifyClass
from Products.CMFCore.interfaces.portal_actions \
@@ -367,7 +371,7 @@
notified = wf.notified( 'before' )
self.assertEqual( len( notified ), 1 )
self.assertEqual( notified[0], ( ob, 'action' ) )
-
+
notified = wf.notified( 'before-evt' )
self.assertEqual( len( notified ), 1 )
self.assertEqual( notified[0], ( ob, 'action' ) )
@@ -385,7 +389,7 @@
notified = wf.notified( 'success' )
self.assertEqual( len( notified ), 1 )
self.assertEqual( notified[0], ( ob, 'action', None ) )
-
+
notified = wf.notified( 'success-evt' )
self.assertEqual( len( notified ), 1 )
self.assertEqual( notified[0], ( ob, 'action', None ) )
@@ -403,7 +407,7 @@
notified = wf.notified( 'exception' )
self.assertEqual( len( notified ), 1 )
self.assertEqual( notified[0], ( ob, 'action', 'exception' ) )
-
+
notified = wf.notified( 'exception-evt' )
self.assertEqual( len( notified ), 1 )
self.assertEqual( notified[0], ( ob, 'action', 'exception' ) )
Modified: CMF/branches/2.1/CMFDefault/DefaultWorkflow.py
===================================================================
--- CMF/branches/2.1/CMFDefault/DefaultWorkflow.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFDefault/DefaultWorkflow.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -15,13 +15,12 @@
$Id$
"""
+from AccessControl import ClassSecurityInfo
from Acquisition import aq_base
from Acquisition import aq_inner
from Acquisition import aq_parent
-from AccessControl import ClassSecurityInfo
from DateTime import DateTime
from Globals import InitializeClass
-
from zope.component import getUtility
from zope.interface import implements
@@ -41,7 +40,7 @@
from permissions import View
-class DefaultWorkflowDefinition (SimpleItemWithProperties):
+class DefaultWorkflowDefinition(SimpleItemWithProperties):
""" Default workflow definition.
"""
Modified: CMF/branches/2.1/CMFDefault/DiscussionTool.py
===================================================================
--- CMF/branches/2.1/CMFDefault/DiscussionTool.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFDefault/DiscussionTool.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -20,7 +20,6 @@
from Globals import DTMLFile
from Globals import InitializeClass
from OFS.SimpleItem import SimpleItem
-
from zope.component import getUtility
from zope.interface import implements
@@ -39,12 +38,11 @@
from exceptions import DiscussionNotAllowed
from permissions import ManagePortal
from permissions import ModifyPortalContent
-from permissions import ReplyToItem
from utils import _dtmldir
-
_marker = []
+
class DiscussionTool(UniqueObject, SimpleItem):
""" Links content to discussions.
@@ -129,4 +127,3 @@
InitializeClass( DiscussionTool )
registerToolInterface('portal_discussion', IDiscussionTool)
-
Modified: CMF/branches/2.1/CMFDefault/MetadataTool.py
===================================================================
--- CMF/branches/2.1/CMFDefault/MetadataTool.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFDefault/MetadataTool.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -16,7 +16,6 @@
"""
from AccessControl import ClassSecurityInfo
-from AccessControl import getSecurityManager
from Globals import DTMLFile
from Globals import InitializeClass
from Globals import PersistentMapping
@@ -38,6 +37,7 @@
class MetadataElementPolicy( SimpleItem ):
+
""" Represent a type-specific policy about a particular metadata element.
"""
@@ -115,8 +115,10 @@
class ElementSpec( SimpleItem ):
+
""" Represent all the tool knows about a single metadata element.
"""
+
security = ClassSecurityInfo()
#
@@ -143,7 +145,7 @@
security.declareProtected(View , 'getPolicy')
def getPolicy( self, typ=None ):
""" Find the policy for this element for objects of the given type.
-
+
o Return a default, if none found.
"""
try:
@@ -175,7 +177,7 @@
security.declareProtected(ManagePortal, 'removePolicy')
def removePolicy( self, typ ):
""" Remove the policy from this element for objects of the given type.
-
+
o Do *not* remvoe the default, however.
"""
if typ is None:
@@ -186,8 +188,10 @@
class MetadataSchema( SimpleItem ):
+
""" Describe a metadata schema.
"""
+
security = ClassSecurityInfo()
meta_type = 'Metadata Schema'
@@ -278,7 +282,7 @@
, REQUEST=None
):
""" Update a policy for one of our elements
-
+
o 'content_type' will be '<default>' when we edit the default.
"""
if content_type == '<default>':
@@ -348,7 +352,7 @@
security.declareProtected(ManagePortal, 'listPolicies')
def listPolicies( self, typ=None ):
""" Show all policies for a given content type
-
+
o If 'typ' is none, return the list of default policies.
"""
result = []
@@ -618,4 +622,3 @@
InitializeClass( MetadataTool )
registerToolInterface('portal_metadata', IMetadataTool)
-
Modified: CMF/branches/2.1/CMFDefault/RegistrationTool.py
===================================================================
--- CMF/branches/2.1/CMFDefault/RegistrationTool.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFDefault/RegistrationTool.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -54,7 +54,7 @@
# the template will be made with a blank To:, this is bad
if email is None:
msg = _(u'No email address is registered for member: '
- u'${member_id}', mapping={'member_id': new_member_id})
+ u'${member_id}', mapping={'member_id': member.getId()})
raise ValueError(msg)
checkEmailAddress(email)
@@ -213,4 +213,3 @@
InitializeClass(RegistrationTool)
registerToolInterface('portal_registration', IRegistrationTool)
-
Modified: CMF/branches/2.1/CMFDefault/skins/zpt_control/change_password.py
===================================================================
--- CMF/branches/2.1/CMFDefault/skins/zpt_control/change_password.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFDefault/skins/zpt_control/change_password.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -16,6 +16,6 @@
if member.getProperty('last_login_time') == DateTime('1999/01/01'):
member.setProperties(last_login_time='2000/01/01')
-mtool.credentialsChanged(password)
+mtool.credentialsChanged(password, context.REQUEST)
return context.setStatus(True, _(u'Password changed.'))
Modified: CMF/branches/2.1/CMFDefault/tests/test_MembershipTool.py
===================================================================
--- CMF/branches/2.1/CMFDefault/tests/test_MembershipTool.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFDefault/tests/test_MembershipTool.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -19,12 +19,8 @@
import Testing
from AccessControl.SecurityManagement import newSecurityManager
-
-from zope.component import getSiteManager
from zope.testing.cleanup import cleanUp
-from Products.CMFCore.interfaces import IConfigurableWorkflowTool
-from Products.CMFCore.interfaces import IMembershipTool
from Products.CMFCore.PortalFolder import PortalFolder
from Products.CMFCore.tests.base.dummy import DummyFolder
from Products.CMFCore.tests.base.dummy import DummySite
@@ -54,7 +50,6 @@
def test_z3interfaces(self):
from zope.interface.verify import verifyClass
- from Products.CMFCore.interfaces import IActionProvider
from Products.CMFDefault.interfaces import IMembershipTool
from Products.CMFDefault.MembershipTool import MembershipTool
Modified: CMF/branches/2.1/CMFDefault/tests/test_MetadataTool.py
===================================================================
--- CMF/branches/2.1/CMFDefault/tests/test_MetadataTool.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFDefault/tests/test_MetadataTool.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -41,7 +41,7 @@
def test_edit_single_valued( self ):
sv_policy = self._makeOne( 0 )
- sv_policy.edit( 1, 1, 'xxx', 0, '' )
+ sv_policy.edit( 1, 1, 'xxx', 0, '' )
self.failIf( sv_policy.isMultiValued() )
self.failUnless( sv_policy.isRequired() )
self.failUnless( sv_policy.supplyDefault() )
@@ -384,8 +384,6 @@
self.assertRaises( MetadataError, tool.setInitialMetadata, foo )
def test_initialValues_explicit_mutliple_types( self ):
- from Products.CMFDefault.exceptions import MetadataError
-
tool = self._makeOne()
dcmi = tool.DCMI
foo, bar = self._makeTestObjects()
@@ -492,7 +490,6 @@
def test_migration( self ):
# Test that we forward-migrate old-style DCMI policies.
from Products.CMFDefault.MetadataTool import ElementSpec
- from Products.CMFDefault.MetadataTool import _DCMI_ELEMENT_SPECS
tool = self._makeOne()
tool.element_specs = { 'Title' : ElementSpec( 0 )
Modified: CMF/branches/2.1/CMFDefault/tests/test_SyndicationTool.py
===================================================================
--- CMF/branches/2.1/CMFDefault/tests/test_SyndicationTool.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFDefault/tests/test_SyndicationTool.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -19,8 +19,6 @@
import Testing
from DateTime.DateTime import DateTime
-
-from zope.component import getSiteManager
from zope.testing.cleanup import cleanUp
from Products.CMFCore.tests.base.testcase import SecurityTest
Modified: CMF/branches/2.1/CMFUid/UniqueIdAnnotationTool.py
===================================================================
--- CMF/branches/2.1/CMFUid/UniqueIdAnnotationTool.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFUid/UniqueIdAnnotationTool.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -25,18 +25,16 @@
from OFS.interfaces import IObjectClonedEvent
from OFS.PropertyManager import PropertyManager
from OFS.SimpleItem import SimpleItem
-
from zope.app.container.interfaces import IObjectAddedEvent
from zope.component import queryUtility
from zope.interface import implements
-from Products.CMFCore.utils import UniqueObject
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.utils import registerToolInterface
+from Products.CMFCore.utils import UniqueObject
from Products.CMFUid.interfaces import IUniqueIdAnnotation
from Products.CMFUid.interfaces import IUniqueIdAnnotationManagement
-from Products.CMFUid.interfaces import IUniqueIdHandler
from Products.CMFUid.interfaces import UniqueIdError
@@ -154,4 +152,3 @@
InitializeClass(UniqueIdAnnotationTool)
registerToolInterface('portal_uidannotation', IUniqueIdAnnotationManagement)
-
Modified: CMF/branches/2.1/CMFUid/tests/test_uidannotation.py
===================================================================
--- CMF/branches/2.1/CMFUid/tests/test_uidannotation.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFUid/tests/test_uidannotation.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -18,9 +18,9 @@
import unittest
import Testing
+import transaction
from AccessControl.SecurityManagement import newSecurityManager
from Acquisition import Implicit
-import transaction
from zope.component import getSiteManager
from zope.component import getUtility
@@ -29,13 +29,13 @@
from Products.CMFCore.PortalFolder import PortalFolder
from Products.CMFCore.tests.base.dummy import DummyContent
from Products.CMFCore.tests.base.testcase import SecurityTest
-from Products.CMFCore.tests.test_CMFCatalogAware import TheClass
from Products.CMFCore.tests.test_CMFCatalogAware import SimpleFolder
+from Products.CMFCore.tests.test_CMFCatalogAware import TheClass
from Products.CMFCore.tests.test_PortalFolder import _AllowedUser
from Products.CMFCore.tests.test_PortalFolder import _SensitiveSecurityPolicy
from Products.CMFUid.interfaces import IUniqueIdAnnotationManagement
-from Products.CMFUid.interfaces import UniqueIdError
from Products.CMFUid.interfaces import IUniqueIdHandler
+from Products.CMFUid.interfaces import UniqueIdError
from Products.CMFUid.testing import UidEventZCMLLayer
UID_ATTRNAME = 'cmf_uid'
@@ -82,9 +82,6 @@
sm.registerUtility( self.root.portal_uidannotation
, IUniqueIdAnnotationManagement
)
- sm.registerUtility( self.root.portal_uidhandler
- , IUniqueIdHandler
- )
self.root._setObject('dummy', DummyContent(id='dummy'))
self.root._setObject('site', SimpleFolder('site'))
Modified: CMF/branches/2.1/CMFUid/tests/test_uidhandling.py
===================================================================
--- CMF/branches/2.1/CMFUid/tests/test_uidhandling.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/CMFUid/tests/test_uidhandling.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -23,7 +23,6 @@
from Products.CMFCore.tests.base.dummy import DummyContent
from Products.CMFCore.tests.base.dummy import DummyFolder
-from Products.CMFCore.tests.base.dummy import DummySite
from Products.CMFCore.tests.base.testcase import SecurityTest
from Products.CMFUid.interfaces import IUniqueIdAnnotationManagement
from Products.CMFUid.interfaces import IUniqueIdGenerator
@@ -72,8 +71,9 @@
from Products.CMFUid.interfaces import IUniqueIdBrainQuery
from Products.CMFUid.interfaces import IUniqueIdHandler
from Products.CMFUid.interfaces import IUniqueIdUnrestrictedQuery
+
+ verifyClass(IUniqueIdBrainQuery, self._getTargetClass())
verifyClass(IUniqueIdHandler, self._getTargetClass())
- verifyClass(IUniqueIdBrainQuery, self._getTargetClass())
verifyClass(IUniqueIdUnrestrictedQuery, self._getTargetClass())
def test_getUidOfNotYetRegisteredObject(self):
Modified: CMF/branches/2.1/DCWorkflow/DCWorkflow.py
===================================================================
--- CMF/branches/2.1/DCWorkflow/DCWorkflow.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/DCWorkflow/DCWorkflow.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -25,9 +25,8 @@
from Globals import InitializeClass
from OFS.Folder import Folder
from OFS.ObjectManager import bad_id
-
-from zope.interface import implements
from zope.event import notify
+from zope.interface import implements
# CMFCore
from Products.CMFCore.interfaces import IWorkflowDefinition
@@ -39,17 +38,17 @@
from Products.CMFCore.WorkflowCore import WorkflowException
# DCWorkflow
+from events import BeforeTransitionEvent, AfterTransitionEvent
+from Expression import createExprContext
+from Expression import StateChangeInfo
from interfaces import IDCWorkflowDefinition
from permissions import ManagePortal
+from Transitions import TRIGGER_AUTOMATIC
+from Transitions import TRIGGER_USER_ACTION
from utils import Message as _
-from utils import modifyRolesForPermission
from utils import modifyRolesForGroup
+from utils import modifyRolesForPermission
from WorkflowUIMixin import WorkflowUIMixin
-from Transitions import TRIGGER_AUTOMATIC
-from Transitions import TRIGGER_USER_ACTION
-from Expression import StateChangeInfo
-from Expression import createExprContext
-from events import BeforeTransitionEvent, AfterTransitionEvent
def checkId(id):
res = bad_id(id)
@@ -470,7 +469,7 @@
msg = _(u'Destination state undefined: ${state_id}',
mapping={'state_id': new_state})
raise WorkflowException(msg)
-
+
# Fire "before" event
notify(BeforeTransitionEvent(ob, self, old_sdef, new_sdef, tdef, former_status, kwargs))
Modified: CMF/branches/2.1/DCWorkflow/tests/test_exportimport.py
===================================================================
--- CMF/branches/2.1/DCWorkflow/tests/test_exportimport.py 2007-06-24 07:55:55 UTC (rev 77003)
+++ CMF/branches/2.1/DCWorkflow/tests/test_exportimport.py 2007-06-24 08:57:54 UTC (rev 77004)
@@ -27,9 +27,6 @@
import _EMPTY_TOOL_EXPORT
from Products.CMFCore.exportimport.tests.test_workflow \
import _WorkflowSetup as WorkflowSetupBase
-from Products.CMFCore.exportimport.tests.test_workflow \
- import DummyWorkflowTool
-from Products.CMFCore.interfaces import IConfigurableWorkflowTool
from Products.CMFCore.testing import DummyWorkflow
from Products.DCWorkflow.DCWorkflow import DCWorkflowDefinition
from Products.DCWorkflow.testing import ExportImportZCMLLayer
@@ -783,8 +780,6 @@
def test_parseWorkflowXML_normal_variables( self ):
- from Products.DCWorkflow.exportimport import TRIGGER_TYPES
-
WF_ID = 'normal'
WF_TITLE = 'Normal DCWorkflow'
WF_DESCRIPTION = 'Normal workflow'
@@ -863,8 +858,6 @@
def test_parseWorkflowXML_normal_worklists( self ):
- from Products.DCWorkflow.exportimport import TRIGGER_TYPES
-
WF_ID = 'normal'
WF_TITLE = 'Normal DCWorkflow'
WF_DESCRIPTION = 'Normal workflow'
@@ -927,8 +920,6 @@
def test_parseWorkflowXML_normal_permissions( self ):
- from Products.DCWorkflow.exportimport import TRIGGER_TYPES
-
WF_ID = 'normal'
WF_TITLE = 'Normal DCWorkflow'
WF_DESCRIPTION = 'Normal workflow'
@@ -966,8 +957,6 @@
def test_parseWorkflowXML_normal_scripts( self ):
- from Products.DCWorkflow.exportimport import TRIGGER_TYPES
-
WF_ID = 'normal'
WF_TITLE = 'Normal DCWorkflow'
WF_DESCRIPTION = 'Normal workflow'
More information about the CMF-checkins
mailing list