Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
PluggableAuthService.tests.test_UserFolder.UserEvents Class Reference
Inheritance diagram for PluggableAuthService.tests.test_UserFolder.UserEvents:
Inheritance graph
[legend]
Collaboration diagram for PluggableAuthService.tests.test_UserFolder.UserEvents:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testUserCreationEvent
def testCredentialsEvent

Public Attributes

 uf

Detailed Description

Definition at line 302 of file test_UserFolder.py.


Member Function Documentation

Definition at line 304 of file test_UserFolder.py.

00304 
00305     def afterSetUp(self):
00306         # Set up roles and a user
00307         self.uf = self.folder.acl_users
00308         self.folder._addRole('role1')
00309         self.folder.manage_role('role1', [View])
00310         self.uf.roles.addRole('role1')
00311         self.folder._addRole('role2')
00312         self.uf._doAddUser('user1', 'secret', ['role1'], [])

Definition at line 325 of file test_UserFolder.py.

00325 
00326     def testCredentialsEvent(self):
00327         provideHandler(PASEventNotify)
00328         provideHandler(userCredentialsUpdatedHandler)
00329         def wrap(self, *args):
00330             self._data.append(args)
00331             return self._original(*args)
00332         self.uf._data=[]
00333         self.uf._original=self.uf.updateCredentials
00334         self.uf.updateCredentials=wrap
00335         event.notify(CredentialsUpdated(self.uf.getUserById("user1"), "testpassword"))
00336         self.assertEqual(len(self.uf._data), 1)
00337         self.assertEqual(self.uf._data[0][2], "user1")
00338         self.assertEqual(self.uf._data[0][3], "testpassword")
00339 
00340 

Here is the call graph for this function:

Definition at line 313 of file test_UserFolder.py.

00313 
00314     def testUserCreationEvent(self):
00315         provideHandler(userCreatedHandler)
00316         self.uf.events = []
00317 
00318         self.uf._doAddUser('event1', 'secret', ['role1'], [])
00319 
00320         self.assertEqual(len(self.uf.events), 1)
00321         event = self.uf.events[0]
00322         self.failUnless(IPrincipalCreatedEvent.providedBy(event))
00323         self.assertEqual(event.principal.getUserName(), 'event1')
00324         self.assertEqual(event.principal.getId(), 'event1')


Member Data Documentation

Definition at line 306 of file test_UserFolder.py.


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