[CMF-checkins] CVS: CMF/CMFDefault/tests - test_MembershipTool.py:1.11

Yvo Schubbe schubbe at web.de
Fri Jan 2 07:42:33 EST 2004


Update of /cvs-repository/CMF/CMFDefault/tests
In directory cvs.zope.org:/tmp/cvs-serv22651/CMFDefault/tests

Modified Files:
	test_MembershipTool.py 
Log Message:
- synced MembershipTool tests


=== CMF/CMFDefault/tests/test_MembershipTool.py 1.10 => 1.11 ===
--- CMF/CMFDefault/tests/test_MembershipTool.py:1.10	Tue Dec 23 16:47:26 2003
+++ CMF/CMFDefault/tests/test_MembershipTool.py	Fri Jan  2 07:42:32 2004
@@ -12,38 +12,26 @@
 except ImportError:
     # for Zope versions before 2.6.0
     from Interface import verify_class_implementation as verifyClass
+
 from AccessControl.SecurityManagement import newSecurityManager
 
 from Products.CMFCore.PortalFolder import PortalFolder
-from Products.CMFCore.tests.base.dummy import DummyFolder as DummyFolderBase
+from Products.CMFCore.tests.base.dummy import DummyFolder
+from Products.CMFCore.tests.base.dummy import DummySite
 from Products.CMFCore.tests.base.dummy import DummyTool
 from Products.CMFCore.tests.base.dummy import DummyUserFolder
 from Products.CMFCore.tests.base.testcase import SecurityTest
-
 from Products.CMFDefault.MembershipTool import MembershipTool
 
 
-class DummyFolder(DummyFolderBase):
-    def manage_addPortalFolder(self, id, title=''):
-        self._setObject( id, DummyFolder() )
-    def changeOwnership(self, user):
-        pass
-    def manage_setLocalRoles(self, userid, roles):
-        pass
-    def getPhysicalRoot(self):
-        return self
-    def unrestrictedTraverse(self, path, default=None, restricted=0):
-        return self.acl_users
-
-
 class MembershipToolTests(TestCase):
 
     def setUp(self):
-        self.site = DummyFolder()
-        self.mtool = MembershipTool().__of__(self.site)
+        self.site = DummySite('site')
+        self.site._setObject( 'portal_membership', MembershipTool() )
 
     def test_MembersFolder_methods(self):
-        mtool = self.mtool
+        mtool = self.site.portal_membership
         self.assertEqual( mtool.getMembersFolder(), None )
         self.site._setObject( 'Members', DummyFolder() )
         self.assertEqual( mtool.getMembersFolder(), self.site.Members )
@@ -68,8 +56,7 @@
 
     def setUp(self):
         SecurityTest.setUp(self)
-        self.site = DummyFolder()
-        self.site.id = 'testSite'
+        self.site = DummySite('site').__of__(self.root)
         self.site._setObject( 'portal_membership', MembershipTool() )
 
     def test_createMemberArea(self):




More information about the CMF-checkins mailing list