Changeset 13987 for main/waeup.kofa/trunk/src
- Timestamp:
- 24 Jun 2016, 06:48:18 (9 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/mandates
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/mandates/mandate.py
r13986 r13987 70 70 if self.expires < datetime.utcnow(): 71 71 msg = _('Mandate expired.') 72 if self._setPassword():72 elif self._setPassword(): 73 73 msg = _('Password has been successfully set. ' 74 74 'Login with your new password.') -
main/waeup.kofa/trunk/src/waeup/kofa/mandates/tests.py
r13986 r13987 89 89 # Add and execute a mandate with missing parameters. 90 90 mandate = PasswordMandate() 91 IUserAccount(student).setPassword('old_pw') 91 92 self.app['mandates'].addMandate(mandate) 92 93 (msg, redirect_path) = mandate.execute() … … 95 96 # Add and execute an expired mandate. 96 97 mandate = PasswordMandate(days=0) 98 mandate.params['user'] = student 99 mandate.params['password'] = 'mypwd1' 97 100 self.app['mandates'].addMandate(mandate) 98 101 (msg, redirect_path) = mandate.execute() 99 102 self.assertEqual(msg, u'Mandate expired.') 100 103 self.assertEqual(redirect_path, '') 104 # Password has not been set 105 self.assertTrue(IUserAccount(student).checkPassword('old_pw')) 101 106 # Add and execute a perfect mandate 102 107 mandate = PasswordMandate()
Note: See TracChangeset for help on using the changeset viewer.