[CMF-checkins] CVS: CMF/CMFCore/tests/base - dummy.py:1.7.2.1 security.py:1.3.10.1

Yvo Schubbe schubbe@web.de
Thu, 29 May 2003 10:40:28 -0400


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

Modified Files:
      Tag: yuppie-createMemberarea-branch
	dummy.py security.py 
Log Message:
changed member area creation:
- made logged_in page instead of wrapUser call 'createMemberarea'
- made MembershipTool folderish to store skeleton content inside
- added a hook to 'createMemberarea' to customize member content creation
- adjusted tests

=== CMF/CMFCore/tests/base/dummy.py 1.7 => 1.7.2.1 ===
--- CMF/CMFCore/tests/base/dummy.py:1.7	Wed May 28 06:57:41 2003
+++ CMF/CMFCore/tests/base/dummy.py	Thu May 29 10:39:57 2003
@@ -167,16 +167,37 @@
 
     def _setObject(self,id,object):
         setattr(self,id,object)
+        return getattr(self, id)
 
 
-class DummyUserFolder(DummyFolder):
+class DummyUser(Implicit):
+
+    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):
+
     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 +236,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.3.10.1 ===
--- CMF/CMFCore/tests/base/security.py:1.3	Fri Mar 14 14:11:40 2003
+++ CMF/CMFCore/tests/base/security.py	Thu May 29 10:39:57 2003
@@ -61,7 +61,7 @@
       Anonymous USer for unit testing purposes.
     """
     def getId( self ):
-        return 'unit_tester'
+        return 'Anonymous User'
     
     getUserName = getId