Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testMD5BaseAttribute
def testGetRandomPassword
def testGetDeterministicPassword
def testGeneratePassword
def testGenerateResetCode
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 registration

Detailed Description

Definition at line 95 of file testRegistrationTool.py.


Member Function Documentation

Definition at line 97 of file testRegistrationTool.py.

00097 
00098     def afterSetUp(self):
00099         self.registration = self.portal.portal_registration

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 124 of file testRegistrationTool.py.

00124 
00125     def testGeneratePassword(self):
00126         pw = self.registration.generatePassword()
00127         self.assertEqual(len(pw), 6)

Definition at line 128 of file testRegistrationTool.py.

00128 
00129     def testGenerateResetCode(self):
00130         salt = 'foo'
00131         rc = self.registration.generateResetCode(salt)
00132         self.assertEqual(rc, self.registration.generateResetCode(salt))
00133 

Definition at line 112 of file testRegistrationTool.py.

00112 
00113     def testGetDeterministicPassword(self):
00114         salt = 'foo'
00115         pw = self.registration.getPassword(6, salt)
00116         self.assertEqual(len(pw), 6)
00117         # Passing in the same length and salt should give the same
00118         # result, every time.
00119         self.assertEqual(pw, self.registration.getPassword(6, salt))
00120         self.assertEqual(pw, self.registration.getPassword(6, salt))
00121         # These should fail
00122         self.failIfEqual(pw, self.registration.getPassword(7, salt))
00123         self.failIfEqual(pw, self.registration.getPassword(6, salt+'x'))

Definition at line 108 of file testRegistrationTool.py.

00108 
00109     def testGetRandomPassword(self):
00110         pw = self.registration.getPassword(6)
00111         self.assertEqual(len(pw), 6)

Definition at line 100 of file testRegistrationTool.py.

00100 
00101     def testMD5BaseAttribute(self):
00102         # Verify that if the _v_md5base attribute is missing, things
00103         # fall back to the class attribute and its default value.
00104         self.registration._md5base()
00105         self.failIfEqual(self.registration._v_md5base, None)
00106         delattr(self.registration, '_v_md5base')
00107         self.assertEqual(self.registration._v_md5base, None)


Member Data Documentation

Definition at line 98 of file testRegistrationTool.py.


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