Changeset 8860
- Timestamp:
- 30 Jun 2012, 08:20:12 (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
r8859 r8860 51 51 52 52 class PasswordMandate(Mandate): 53 """This is a mandate which can set a studentpassword.53 """This is a mandate which can set a password. 54 54 """ 55 55 … … 72 72 msg = _('Password has been successfully set. ' 73 73 'Proceed to the login page and enter your credentials.') 74 username = IUserAccount(self.params['user']).name 75 grok.getSite().logger.info( 76 'PasswordMandate used: %s ' % username) 74 77 del self.__parent__[self.mandate_id] 75 78 return msg -
main/waeup.kofa/trunk/src/waeup/kofa/mandates/tests.py
r8859 r8860 21 21 import tempfile 22 22 import shutil 23 import os 23 24 from zope.testbrowser.testing import Browser 24 25 from datetime import datetime, timedelta … … 108 109 # All mandates have been removed. 109 110 self.assertEqual(len(self.app['mandates'].keys()), 0) 111 logfile = os.path.join( 112 self.app['datacenter'].storage, 'logs', 'main.log') 113 logcontent = open(logfile).read() 114 self.assertTrue('system - PasswordMandate used: K1000000' in logcontent) 110 115 111 116 def test_set_officer_password(self): … … 121 126 'the login page and enter your credentials.') 122 127 self.assertTrue(IUserAccount(officer).checkPassword('mypwd1')) 128 logfile = os.path.join( 129 self.app['datacenter'].storage, 'logs', 'main.log') 130 logcontent = open(logfile).read() 131 self.assertTrue('system - PasswordMandate used: bob' in logcontent) 123 132 124 133 def test_set_applicant_password(self): 125 134 applicant = createObject('waeup.Applicant') 135 applicant.applicant_id = u'abc' 126 136 mandate = PasswordMandate() 127 137 mandate.params['user'] = applicant … … 133 143 'the login page and enter your credentials.') 134 144 self.assertTrue(IUserAccount(applicant).checkPassword('mypwd1')) 145 logfile = os.path.join( 146 self.app['datacenter'].storage, 'logs', 'main.log') 147 logcontent = open(logfile).read() 148 self.assertTrue('system - PasswordMandate used: abc' in logcontent) 135 149 136 150 def test_remove_expired(self):
Note: See TracChangeset for help on using the changeset viewer.