[CMF-checkins] SVN: CMF/branches/1.6/CMF - fixed failing test

Yvo Schubbe y.2005- at wcm-solutions.de
Thu Nov 24 13:23:01 EST 2005


Log message for revision 40364:
  - fixed failing test
  - some cleanup and syncing with 1.5

Changed:
  U   CMF/branches/1.6/CMFCore/TypesTool.py
  U   CMF/branches/1.6/CMFCore/__init__.py
  U   CMF/branches/1.6/CMFCore/tests/test_WorkflowTool.py
  U   CMF/branches/1.6/CMFDefault/Document.py
  U   CMF/branches/1.6/CMFDefault/File.py
  U   CMF/branches/1.6/CMFDefault/Image.py
  U   CMF/branches/1.6/CMFDefault/Link.py
  U   CMF/branches/1.6/CMFDefault/Portal.py

-=-
Modified: CMF/branches/1.6/CMFCore/TypesTool.py
===================================================================
--- CMF/branches/1.6/CMFCore/TypesTool.py	2005-11-24 16:27:37 UTC (rev 40363)
+++ CMF/branches/1.6/CMFCore/TypesTool.py	2005-11-24 18:23:00 UTC (rev 40364)
@@ -639,21 +639,6 @@
 ContentTypeInformation = ScriptableTypeInformation
 
 
-# BBB: typeClasses definition is only needed for older FTI creation
-#      idiom
-typeClasses = [
-    {'class':FactoryTypeInformation,
-     'name':FactoryTypeInformation.meta_type,
-     'action':'manage_addFactoryTIForm',
-     'permission':ManagePortal},
-    {'class':ScriptableTypeInformation,
-     'name':ScriptableTypeInformation.meta_type,
-     'action':'manage_addScriptableTIForm',
-     'permission':ManagePortal},
-    ]
-
-
-
 allowedTypes = [
     'Script (Python)',
     'Python Method',
@@ -809,9 +794,9 @@
                 id = fti.get('id', None)
         if not id:
             raise BadRequest('An id is required.')
-        for mt in typeClasses:
+        for mt in Products.meta_types:
             if mt['name'] == add_meta_type:
-                klass = mt['class']
+                klass = mt['instance']
                 break
         else:
             raise ValueError, (

Modified: CMF/branches/1.6/CMFCore/__init__.py
===================================================================
--- CMF/branches/1.6/CMFCore/__init__.py	2005-11-24 16:27:37 UTC (rev 40363)
+++ CMF/branches/1.6/CMFCore/__init__.py	2005-11-24 18:23:00 UTC (rev 40364)
@@ -32,7 +32,6 @@
 import utils
 
 from permissions import AddPortalFolders
-from permissions import ManagePortal
 
 
 # Old name that some third-party packages may need.

Modified: CMF/branches/1.6/CMFCore/tests/test_WorkflowTool.py
===================================================================
--- CMF/branches/1.6/CMFCore/tests/test_WorkflowTool.py	2005-11-24 16:27:37 UTC (rev 40363)
+++ CMF/branches/1.6/CMFCore/tests/test_WorkflowTool.py	2005-11-24 18:23:00 UTC (rev 40364)
@@ -138,13 +138,22 @@
 
 class WorkflowToolTests(TestCase, WarningInterceptor):
 
+    def setUp( self ):
+        from Products.CMFCore.WorkflowTool import addWorkflowFactory
+        addWorkflowFactory( DummyWorkflow )
+
+    def tearDown( self ):
+        from Products.CMFCore.WorkflowTool import _removeWorkflowFactory
+        _removeWorkflowFactory( DummyWorkflow )
+        self._free_warning_output()
+
     def _makeOne( self, workflow_ids=() ):
         from Products.CMFCore.WorkflowTool import WorkflowTool
 
         tool = WorkflowTool()
 
         for workflow_id in workflow_ids:
-            tool._setObject(workflow_id, DummyWorkflow(workflow_id))
+            tool.manage_addWorkflow( DummyWorkflow.meta_type, workflow_id )
 
         return tool
 

Modified: CMF/branches/1.6/CMFDefault/Document.py
===================================================================
--- CMF/branches/1.6/CMFDefault/Document.py	2005-11-24 16:27:37 UTC (rev 40363)
+++ CMF/branches/1.6/CMFDefault/Document.py	2005-11-24 18:23:00 UTC (rev 40364)
@@ -31,7 +31,6 @@
 from Products.CMFCore.PortalContent import PortalContent
 from Products.CMFCore.utils import contributorsplitter
 from Products.CMFCore.utils import keywordsplitter
-from Products.GenericSetup.interfaces import IDAVAware
 
 from DublinCore import DefaultDublinCoreImpl
 from exceptions import EditingConflict

Modified: CMF/branches/1.6/CMFDefault/File.py
===================================================================
--- CMF/branches/1.6/CMFDefault/File.py	2005-11-24 16:27:37 UTC (rev 40363)
+++ CMF/branches/1.6/CMFDefault/File.py	2005-11-24 18:23:00 UTC (rev 40364)
@@ -21,7 +21,6 @@
 from AccessControl import ClassSecurityInfo
 
 from Products.CMFCore.PortalContent import PortalContent
-from Products.GenericSetup.interfaces import IDAVAware
 
 from DublinCore import DefaultDublinCoreImpl
 from permissions import View

Modified: CMF/branches/1.6/CMFDefault/Image.py
===================================================================
--- CMF/branches/1.6/CMFDefault/Image.py	2005-11-24 16:27:37 UTC (rev 40363)
+++ CMF/branches/1.6/CMFDefault/Image.py	2005-11-24 18:23:00 UTC (rev 40364)
@@ -20,7 +20,6 @@
 from AccessControl import ClassSecurityInfo
 
 from Products.CMFCore.PortalContent import PortalContent
-from Products.GenericSetup.interfaces import IDAVAware
 
 from DublinCore import DefaultDublinCoreImpl
 from permissions import View

Modified: CMF/branches/1.6/CMFDefault/Link.py
===================================================================
--- CMF/branches/1.6/CMFDefault/Link.py	2005-11-24 16:27:37 UTC (rev 40363)
+++ CMF/branches/1.6/CMFDefault/Link.py	2005-11-24 18:23:00 UTC (rev 40364)
@@ -29,7 +29,6 @@
 from Products.CMFCore.PortalContent import PortalContent
 from Products.CMFCore.utils import contributorsplitter
 from Products.CMFCore.utils import keywordsplitter
-from Products.GenericSetup.interfaces import IDAVAware
 
 from DublinCore import DefaultDublinCoreImpl
 from exceptions import ResourceLockedError

Modified: CMF/branches/1.6/CMFDefault/Portal.py
===================================================================
--- CMF/branches/1.6/CMFDefault/Portal.py	2005-11-24 16:27:37 UTC (rev 40363)
+++ CMF/branches/1.6/CMFDefault/Portal.py	2005-11-24 18:23:00 UTC (rev 40364)
@@ -292,11 +292,11 @@
 manage_addCMFSiteForm.__name__ = 'addPortal'
 
 def manage_addCMFSite(self, id, title='Portal', description='',
-                      create_userfolder=1,
-                      email_from_address='postmaster at localhost',
-                      email_from_name='Portal Administrator',
-                      validate_email=0, default_charset='',
-                      RESPONSE=None):
+                         create_userfolder=1,
+                         email_from_address='postmaster at localhost',
+                         email_from_name='Portal Administrator',
+                         validate_email=0, default_charset='',
+                         RESPONSE=None):
     """ Adds a portal instance.
     """
     from warnings import warn



More information about the CMF-checkins mailing list