[CMF-checkins] CVS: CMF/CMFCore/tests/base - dummy.py:1.8 security.py:1.4

Yvo Schubbe schubbe@web.de
Mon, 2 Jun 2003 12:19:18 -0400


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

Modified Files:
	dummy.py security.py 
Log Message:
Merged yuppie-createMemberarea-branch:
- Made logged_in page instead of wrapUser call 'createMemberarea'.
- Added a customization hook to CMFDefault 'createMemberarea'.

=== CMF/CMFCore/tests/base/dummy.py 1.7 => 1.8 ===
--- CMF/CMFCore/tests/base/dummy.py:1.7	Wed May 28 06:57:41 2003
+++ CMF/CMFCore/tests/base/dummy.py	Mon Jun  2 12:18:47 2003
@@ -167,16 +167,41 @@
 
     def _setObject(self,id,object):
         setattr(self,id,object)
+        return getattr(self, id)
 
 
-class DummyUserFolder(DummyFolder):
+class DummyUser(Implicit):
+    """ A dummy User.
+    """
+
+    def __init__(self, id='dummy'):
+        self.id = id
+
+    def getId(self):
+        return self.id
+
+    getUserName = getId
+
+    def allowed(self, object, object_roles=None):
+        if object.getId() == 'portal_membership':
+            return 0
+        return 1
+
+
+class DummyUserFolder(Implicit):
+    """ A dummy User Folder with 2 dummy Users.
+    """
+
     def __init__(self):
-        self._setObject( 'user_foo', DummyObject(id='user_foo') )
-        self._setObject( 'user_bar', DummyObject(id='user_bar') )
+        setattr( self, 'user_foo', DummyUser(id='user_foo') )
+        setattr( self, 'user_bar', DummyUser(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)
 
@@ -215,5 +240,7 @@
         return 'Tool: %s' % relative
 
     # WorkflowTool
+    test_notified = None
+
     def notifyCreated(self, ob):
-        pass
+        self.test_notified = ob


=== CMF/CMFCore/tests/base/security.py 1.3 => 1.4 ===
--- CMF/CMFCore/tests/base/security.py:1.3	Fri Mar 14 14:11:40 2003
+++ CMF/CMFCore/tests/base/security.py	Mon Jun  2 12:18:47 2003
@@ -61,7 +61,7 @@
       Anonymous USer for unit testing purposes.
     """
     def getId( self ):
-        return 'unit_tester'
+        return 'Anonymous User'
     
     getUserName = getId