Changeset 13988 for main/waeup.kofa/trunk/src/waeup/kofa/mandates/tests.py
- Timestamp:
- 24 Jun 2016, 07:14:01 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/mandates/tests.py
r13987 r13988 32 32 IMandatesContainer, IMandate) 33 33 from waeup.kofa.mandates.container import MandatesContainer 34 from waeup.kofa.mandates.mandate import PasswordMandate 34 from waeup.kofa.mandates.mandate import PasswordMandate, RefereeReportMandate 35 35 from waeup.kofa.testing import (FunctionalLayer, FunctionalTestCase) 36 36 … … 191 191 self.assertTrue('1 mandate(s) were purged' in self.browser.contents) 192 192 self.assertEqual(self.app['mandates'].count, (1, 0, 1)) 193 return 194 195 def test_browser(self): 193 194 def test_browser_set_password(self): 196 195 student = createObject('waeup.Student') 197 196 self.app['students'].addStudent(student) … … 219 218 self.assertTrue('Misuse' in self.browser.contents) 220 219 self.assertEqual(self.browser.url, 'http://localhost/app/') 221 return 220 221 def test_refereereport_mandate(self): 222 mandate = RefereeReportMandate() 223 mandate.params['name'] = u'John Referee' 224 mandate.params['email'] = 'aa@aa.aa' 225 mandate.params['redirect_path'] = 'applicants/87689' 226 self.app['mandates'].addMandate(mandate) 227 (msg, redirect_path) = mandate.execute() 228 self.assertEqual(msg, None) 229 self.assertEqual(redirect_path, 'applicants/87689') 230 # Mandate has not been deleted 231 self.assertEqual(len(self.app['mandates'].keys()), 1) 232 mandate.params['redirect_path'] = None 233 (msg, redirect_path) = mandate.execute() 234 self.assertEqual(msg, 'Wrong mandate parameters.') 235 self.assertEqual(redirect_path, '') 236 # Add and execute an expired mandate 237 mandate2 = RefereeReportMandate(days=0) 238 mandate2.params['name'] = u'John Referee' 239 mandate2.params['email'] = 'aa@aa.aa' 240 mandate2.params['redirect_path'] = 'applicants/87689' 241 self.app['mandates'].addMandate(mandate2) 242 (msg, redirect_path) = mandate2.execute() 243 self.assertEqual(msg, 'Mandate expired.') 244 self.assertEqual(redirect_path, '') 245 # Both mandates still exist 246 self.assertEqual(len(self.app['mandates'].keys()), 2)
Note: See TracChangeset for help on using the changeset viewer.