Changeset 8859 for main/waeup.kofa/trunk/src/waeup
- Timestamp:
- 30 Jun 2012, 07:58:20 (12 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
r8858 r8859 57 57 user = self.params.get('user', None) 58 58 pwd = self.params.get('password', None) 59 if user and pwd:59 if not None in (user, pwd): 60 60 try: 61 61 IUserAccount(user).setPassword(pwd) -
main/waeup.kofa/trunk/src/waeup/kofa/mandates/tests.py
r8858 r8859 86 86 def test_set_student_password(self): 87 87 student = createObject('waeup.Student') 88 self.app['students'].addStudent(student)89 88 # Add and execute a mandate with missing parameters. 90 89 mandate = PasswordMandate() … … 123 122 self.assertTrue(IUserAccount(officer).checkPassword('mypwd1')) 124 123 124 def test_set_applicant_password(self): 125 applicant = createObject('waeup.Applicant') 126 mandate = PasswordMandate() 127 mandate.params['user'] = applicant 128 mandate.params['password'] = 'mypwd1' 129 self.app['mandates'].addMandate(mandate) 130 msg = mandate.execute() 131 # Password has been set. 132 self.assertEqual(msg, 'Password has been successfully set. Proceed to ' 133 'the login page and enter your credentials.') 134 self.assertTrue(IUserAccount(applicant).checkPassword('mypwd1')) 135 125 136 def test_remove_expired(self): 126 137 # mandate1 is an old mandate which just expired.
Note: See TracChangeset for help on using the changeset viewer.