[CMF-checkins] CVS: CMF/CMFCore/tests/base - dummy.py:1.6.4.1

Yvo Schubbe schubbe@web.de
Wed, 28 May 2003 06:56:03 -0400


Update of /cvs-repository/CMF/CMFCore/tests/base
In directory cvs.zope.org:/tmp/cvs-serv32344/CMFCore/tests/base

Modified Files:
      Tag: CMF-1_4-branch
	dummy.py 
Log Message:
Merged yuppie-collector162-branch:
- Fixed member area Ownership and Roles. (Collector #162)

=== CMF/CMFCore/tests/base/dummy.py 1.6 => 1.6.4.1 ===
--- CMF/CMFCore/tests/base/dummy.py:1.6	Tue Apr 15 12:08:02 2003
+++ CMF/CMFCore/tests/base/dummy.py	Wed May 28 06:55:32 2003
@@ -5,27 +5,32 @@
 from Products.CMFCore.TypesTool import FactoryTypeInformation as FTI
 from Products.CMFCore.ActionProviderBase import ActionProviderBase
 
+
 class DummyObject(Implicit):
     """
     A dummy callable object.
     Comes with getIcon and restrictedTraverse
     methods.
     """
-    def __init__(self, name='dummy',**kw):
-        self.name = name
+    def __init__(self, id='dummy',**kw):
+        self.id = id
         self.__dict__.update( kw )
         
     def __str__(self):
-        return self.name
+        return self.id
     
     def __call__(self):
-        return self.name
+        return self.id
 
     def restrictedTraverse( self, path ):
         return path and getattr( self, path ) or self
 
     def getIcon( self, relative=0 ):
         return 'Site: %s' % relative
+    
+    def getId(self):
+        return self.id
+
 
 class DummyContent( PortalContent, Item ):
     """
@@ -163,6 +168,19 @@
     def _setObject(self,id,object):
         setattr(self,id,object)
 
+
+class DummyUserFolder(DummyFolder):
+    def __init__(self):
+        self._setObject( 'user_foo', DummyObject(id='user_foo') )
+        self._setObject( 'user_bar', DummyObject(id='user_bar') )
+    def getUsers(self):
+        pass
+    def getUser(self, name):
+        return getattr(self, name, None)
+    def getUserById(self, id, default=None):
+        return self.getUser(id)
+
+
 class DummyTool(Implicit,ActionProviderBase):
     """
     This is a Dummy Tool that behaves as a
@@ -195,3 +213,7 @@
 
     def getIcon( self, relative=0 ):
         return 'Tool: %s' % relative
+
+    # WorkflowTool
+    def notifyCreated(self, ob):
+        pass