[CMF-checkins] CVS: CMF/CMFSetup/tests - common.py:1.11 test_actions.py:1.6 test_registry.py:1.13

Tres Seaver tseaver at zope.com
Thu Jul 1 19:14:53 EDT 2004


Update of /cvs-repository/CMF/CMFSetup/tests
In directory cvs.zope.org:/tmp/cvs-serv17492/tests

Modified Files:
	common.py test_actions.py test_registry.py 
Log Message:


  - __init__.py:

    o Complete setup of "configured CMF Site" factory.

    o Register our default profile, so that we can use it.

  - actions.py:

    o Ensure we pass a proper ActionInformation object to 'listActions'.

    o Ensure we *don't* call 'listActions' on an old-style provider.

  - context.py:

    o Suppress Unicode IDs in ZODB.

  - interfaces.py:

    o Note that 'product' is an optional attribute of a profile.

  - registry.py:

    o Capture 'product' when registering profiles.

  - typeinfo.py:

    o Fix buglet in writing typeinfo XML files in subdir.

  - worfklow.py:

    o Fix buglet in writing definition XML files in subdir.

    o Fix buglets when workflow tool does not yet have overrides.


=== CMF/CMFSetup/tests/common.py 1.10 => 1.11 ===
--- CMF/CMFSetup/tests/common.py:1.10	Fri Jun  4 23:16:49 2004
+++ CMF/CMFSetup/tests/common.py	Thu Jul  1 19:14:23 2004
@@ -140,7 +140,9 @@
     def getSite( self ):
         return self._site
 
-    def writeDataFile( self, filename, text, content_type ):
+    def writeDataFile( self, filename, text, content_type, subdir=None ):
+        if subdir is not None:
+            filename = '%s/%s' % ( subdir, filename )
         self._wrote.append( ( filename, text, content_type ) )
 
 class DummyImportContext:


=== CMF/CMFSetup/tests/test_actions.py 1.5 => 1.6 ===
--- CMF/CMFSetup/tests/test_actions.py:1.5	Tue Jun  8 15:43:42 2004
+++ CMF/CMFSetup/tests/test_actions.py	Thu Jul  1 19:14:23 2004
@@ -5,8 +5,12 @@
 
 import unittest
 
+from Acquisition import Implicit
+from Acquisition import aq_parent
 from OFS.Folder import Folder
 from Products.CMFCore.ActionProviderBase import ActionProviderBase
+from Products.CMFCore.interfaces.portal_actions \
+    import ActionProvider as IActionProvider
 
 from common import BaseRegistryTests
 from common import DummyExportContext
@@ -14,7 +18,20 @@
 
 class DummyTool( Folder, ActionProviderBase ):
 
-    pass
+    __implements__ = ( IActionProvider, )
+
+class DummyUser( Implicit ):
+
+    def getId( self ):
+        return 'dummy'
+
+class DummyMembershipTool( DummyTool ):
+
+    def isAnonymousUser( self ):
+        return False
+
+    def getAuthenticatedMember( self ):
+        return DummyUser().__of__( aq_parent( self ) )
 
 class DummyActionsTool( DummyTool ):
 
@@ -40,6 +57,8 @@
 
         self.root.site = Folder( id='site' )
         site = self.root.site
+
+        site.portal_membership = DummyMembershipTool()
 
         site.portal_actions = DummyActionsTool()
         site.portal_actions.addActionProvider( 'portal_actions' )


=== CMF/CMFSetup/tests/test_registry.py 1.12 => 1.13 ===
--- CMF/CMFSetup/tests/test_registry.py:1.12	Thu Jul  1 14:41:53 2004
+++ CMF/CMFSetup/tests/test_registry.py	Thu Jul  1 19:14:23 2004
@@ -1026,9 +1026,15 @@
         TITLE = 'One'
         DESCRIPTION = 'One profile'
         PATH = '/path/to/one'
+        PRODUCT = 'TestProduct'
 
         registry = self._makeOne()
-        registry.registerProfile( PROFILE_ID, TITLE, DESCRIPTION, PATH )
+        registry.registerProfile( PROFILE_ID
+                                , TITLE
+                                , DESCRIPTION
+                                , PATH
+                                , PRODUCT
+                                )
 
         self.assertEqual( len( registry.listProfiles() ), 1 )
         self.assertEqual( len( registry.listProfileInfo() ), 1 )
@@ -1039,6 +1045,7 @@
         self.assertEqual( info[ 'title' ], TITLE )
         self.assertEqual( info[ 'description' ], DESCRIPTION )
         self.assertEqual( info[ 'path' ], PATH )
+        self.assertEqual( info[ 'product' ], PRODUCT )
 
     def test_registerProfile_duplicate( self ):
 



More information about the CMF-checkins mailing list