Back to index

plone3  3.1.7
Public Member Functions | Private Member Functions
CMFCore.tests.test_MemberDataTool.MemberDataTests Class Reference

List of all members.

Public Member Functions

def test_z2interfaces
def test_z3interfaces
def test_setSecurityProfile

Private Member Functions

def _makeOne

Detailed Description

Definition at line 132 of file test_MemberDataTool.py.


Member Function Documentation

def CMFCore.tests.test_MemberDataTool.MemberDataTests._makeOne (   self,
  args,
  kw 
) [private]

Definition at line 134 of file test_MemberDataTool.py.

00134 
00135     def _makeOne(self, *args, **kw):
00136         from Products.CMFCore.MemberDataTool import MemberData
00137 
00138         return MemberData(*args, **kw)

Definition at line 154 of file test_MemberDataTool.py.

00154 
00155     def test_setSecurityProfile(self):
00156         mdtool = DummyMemberDataTool()
00157         aclu = DummyUserFolder()
00158         user = DummyUser('bob', 'pw', ['Role'], ['domain'])
00159         aclu._addUser(user)
00160         user = user.__of__(aclu)
00161         member = self._makeOne(None, 'bob').__of__(mdtool).__of__(user)
00162         member.setSecurityProfile(password='newpw')
00163         self.assertEqual(user.__, 'newpw')
00164         self.assertEqual(list(user.roles), ['Role'])
00165         self.assertEqual(list(user.domains), ['domain'])
00166         member.setSecurityProfile(roles=['NewRole'])
00167         self.assertEqual(user.__, 'newpw')
00168         self.assertEqual(list(user.roles), ['NewRole'])
00169         self.assertEqual(list(user.domains), ['domain'])
00170         member.setSecurityProfile(domains=['newdomain'])
00171         self.assertEqual(user.__, 'newpw')
00172         self.assertEqual(list(user.roles), ['NewRole'])
00173         self.assertEqual(list(user.domains), ['newdomain'])
00174 

Here is the call graph for this function:

Definition at line 139 of file test_MemberDataTool.py.

00139 
00140     def test_z2interfaces(self):
00141         from Interface.Verify import verifyClass
00142         from Products.CMFCore.interfaces.portal_memberdata \
00143                 import MemberData as IMemberData
00144         from Products.CMFCore.MemberDataTool import MemberData
00145 
00146         verifyClass(IMemberData, MemberData)

Definition at line 147 of file test_MemberDataTool.py.

00147 
00148     def test_z3interfaces(self):
00149         from zope.interface.verify import verifyClass
00150         from Products.CMFCore.interfaces import IMemberData
00151         from Products.CMFCore.MemberDataTool import MemberData
00152 
00153         verifyClass(IMemberData, MemberData)


The documentation for this class was generated from the following file: