[CMF-checkins] CVS: CMF/CMFCore/tests - test_MembershipTool.py:1.9
Yvo Schubbe
schubbe at web.de
Fri Jan 2 07:43:03 EST 2004
Update of /cvs-repository/CMF/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv22651/CMFCore/tests
Modified Files:
test_MembershipTool.py
Log Message:
- synced MembershipTool tests
=== CMF/CMFCore/tests/test_MembershipTool.py 1.8 => 1.9 ===
--- CMF/CMFCore/tests/test_MembershipTool.py:1.8 Mon Sep 29 07:19:39 2003
+++ CMF/CMFCore/tests/test_MembershipTool.py Fri Jan 2 07:42:32 2004
@@ -1,5 +1,6 @@
from unittest import TestCase, TestSuite, makeSuite, main
+import Testing
import Zope
try:
Zope.startup()
@@ -11,17 +12,17 @@
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.MemberDataTool import MemberDataTool
+from Products.CMFCore.MembershipTool import MembershipTool
from Products.CMFCore.PortalFolder import PortalFolder
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.CMFCore.MembershipTool import MembershipTool
-
class MembershipToolTests(TestCase):
@@ -40,10 +41,10 @@
def setUp(self):
SecurityTest.setUp(self)
self.site = DummySite('site').__of__(self.root)
- self.mtool = MembershipTool().__of__(self.site)
+ self.site._setObject( 'portal_membership', MembershipTool() )
def test_getCandidateLocalRoles(self):
- mtool = self.mtool
+ mtool = self.site.portal_membership
acl_users = self.site._setObject( 'acl_users', DummyUserFolder() )
newSecurityManager(None, acl_users.user_foo)
@@ -54,7 +55,7 @@
self.assertEqual( rval, ('Manager', 'Member', 'Owner', 'Reviewer') )
def test_createMemberArea(self):
- mtool = self.mtool
+ mtool = self.site.portal_membership
members = self.site._setObject( 'Members', PortalFolder('Members') )
acl_users = self.site._setObject( 'acl_users', DummyUserFolder() )
wtool = self.site._setObject( 'portal_workflow', DummyTool() )
@@ -84,7 +85,7 @@
% str( f.get_local_roles() ) )
def test_deleteMembers(self):
- mtool = self.mtool
+ mtool = self.site.portal_membership
members = self.site._setObject( 'Members', PortalFolder('Members') )
acl_users = self.site._setObject( 'acl_users', DummyUserFolder() )
utool = self.site._setObject( 'portal_url', DummyTool() )
@@ -104,6 +105,7 @@
self.failIf( acl_users.getUserById('user_foo', None) )
self.failIf( mdtool._members.has_key('user_foo') )
self.failIf( hasattr(members.aq_self, 'user_foo') )
+
def test_suite():
return TestSuite((
More information about the CMF-checkins
mailing list