Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
CMFPlone.tests.testControlPanelScripts.TestPrefsUserManage Class Reference
Inheritance diagram for CMFPlone.tests.testControlPanelScripts.TestPrefsUserManage:
Inheritance graph
[legend]
Collaboration diagram for CMFPlone.tests.testControlPanelScripts.TestPrefsUserManage:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def addMember
def testPrefsAddGroupPostOnly
def testPrefsUserMembershipEditPostOnly
def test_ploneChangePasswordPostOnly
def test_bug4333_delete_user_remove_memberdata
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 membership
 groups

Detailed Description

Definition at line 93 of file testControlPanelScripts.py.


Member Function Documentation

def CMFPlone.tests.testControlPanelScripts.TestPrefsUserManage.addMember (   self,
  username,
  fullname,
  email,
  roles,
  last_login_time 
)

Definition at line 100 of file testControlPanelScripts.py.

00100 
00101     def addMember(self, username, fullname, email, roles, last_login_time):
00102         self.membership.addMember(username, 'secret', roles, [])
00103         member = self.membership.getMemberById(username)
00104         member.setMemberProperties({'fullname': fullname, 'email': email,
00105                                     'last_login_time': DateTime(last_login_time),})

Here is the caller graph for this function:

Definition at line 95 of file testControlPanelScripts.py.

00095 
00096     def afterSetUp(self):
00097         self.membership = self.portal.portal_membership
00098         self.membership.memberareaCreationFlag = 0
00099         self.setupAuthenticator()

Definition at line 30 of file PloneTestCase.py.

00030 
00031     def getAuthenticator(self):
00032         tag = AuthenticatorView('context', 'request').authenticator()
00033         pattern = '<input .*name="(\w+)".*value="(\w+)"'
00034         return match(pattern, tag).groups()

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.tests.PloneTestCase.PloneTestCase.setRequestMethod (   self,
  method 
) [inherited]
This is a stub now, but in case you want to try
   something fancy on Your Branch (tm), put it here.

Definition at line 26 of file PloneTestCase.py.

00026 
00027     def setRequestMethod(self, method):
00028         self.app.REQUEST.set('REQUEST_METHOD', method)
00029         self.app.REQUEST.method = method

Here is the caller graph for this function:

Definition at line 35 of file PloneTestCase.py.

00035 
00036     def setupAuthenticator(self):
00037         name, token = self.getAuthenticator()
00038         self.app.REQUEST.form[name] = token
00039 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 128 of file testControlPanelScripts.py.

00128 
00129     def test_bug4333_delete_user_remove_memberdata(self):
00130         # delete user should delete portal_memberdata
00131         memberdata = self.portal.portal_memberdata
00132         self.setRoles(['Manager'])
00133         self.addMember('barney', 'Barney Rubble', 'barney@bedrock.com', ['Member'], '2002-01-01')
00134         barney = self.membership.getMemberById('barney')
00135         self.failUnlessEqual(barney.getProperty('email'), 'barney@bedrock.com')
00136         del barney
00137 
00138         self.setRequestMethod('POST')
00139         self.portal.prefs_user_manage(delete=['barney'])
00140         self.setRequestMethod('GET')
00141         md = memberdata._members
00142         self.failIf(md.has_key('barney'))
00143 
00144         # There is an _v_ variable that is killed at the end of each request
00145         # which stores a temporary version of the member object, this is
00146         # a problem in this test.
00147         memberdata._v_temps = None
00148 
00149         self.membership.addMember('barney', 'secret', ['Member'], [])
00150         barney = self.membership.getMemberById('barney')
00151         self.failIfEqual(barney.getProperty('fullname'), 'Barney Rubble')
00152         self.failIfEqual(barney.getProperty('email'), 'barney@bedrock.com')
00153 

Here is the call graph for this function:

Definition at line 123 of file testControlPanelScripts.py.

00123 
00124     def test_ploneChangePasswordPostOnly(self):
00125         self.login(default_user) 
00126         self.setRequestMethod('GET')
00127         self.assertRaises(Forbidden, self.portal.plone_change_password, current=default_password, password=default_password, password_confirm=default_password)

Here is the call graph for this function:

Definition at line 106 of file testControlPanelScripts.py.

00106 
00107     def testPrefsAddGroupPostOnly(self):
00108         self.setRoles(['Manager']) 
00109         self.setRequestMethod('GET')
00110         self.assertRaises(Forbidden, self.portal.prefs_group_edit, addname='foo')

Here is the call graph for this function:

Definition at line 111 of file testControlPanelScripts.py.

00111 
00112     def testPrefsUserMembershipEditPostOnly(self):
00113        self.setRoles(['Manager'])
00114         self.groups = self.portal.portal_groups
00115         self.groups.groupWorkspacesCreationFlag = 0
00116         self.groups.addGroup('foo')
00117         self.setRequestMethod('GET')
00118         self.app.REQUEST.set('delete',['foo'])
00119         self.assertRaises(Forbidden, self.portal.prefs_user_membership_edit, userid='barney')
00120         del self.app.REQUEST.other['delete']
00121         self.app.REQUEST.set('add',['foo'])
00122         self.assertRaises(Forbidden, self.portal.prefs_user_membership_edit, userid='barney')

Here is the call graph for this function:


Member Data Documentation

Definition at line 113 of file testControlPanelScripts.py.

Definition at line 96 of file testControlPanelScripts.py.


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