Changeset 9021 for main/waeup.kofa
- Timestamp:
- 18 Jul 2012, 20:24:55 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r9010 r9021 1665 1665 return 1666 1666 self.flash(_('Clearance form has been saved.')) 1667 self.redirect(self.url(self.context,'request_clearance')) 1667 if self.context.clr_code: 1668 self.redirect(self.url(self.context, 'request_clearance')) 1669 else: 1670 # We bypass the request_clearance page if student 1671 # has been imported in state 'clearance started' and 1672 # no clr_code was entered before. 1673 state = IWorkflowState(self.context).getState() 1674 if state != CLEARANCE: 1675 # This shouldn't happen, but the application officer 1676 # might have forgotten to lock the form after changing the state 1677 self.flash(_('This form cannot be submitted. Wrong state!')) 1678 return 1679 IWorkflowInfo(self.context).fireTransition('request_clearance') 1680 self.flash(_('Clearance has been requested.')) 1681 self.redirect(self.url(self.context)) 1668 1682 return 1669 1683 … … 1685 1699 return 1686 1700 pin = '%s-%s-%s' % (self.ac_prefix, self.ac_series, self.ac_number) 1687 if self.context.clr_code != pin:1701 if self.context.clr_code and self.context.clr_code != pin: 1688 1702 self.flash(_("This isn't your CLR access code.")) 1689 1703 return 1690 1704 state = IWorkflowState(self.context).getState() 1691 # This shouldn't happen, but the application officer1692 # might have forgotten to lock the form after changing the state1693 1705 if state != CLEARANCE: 1706 # This shouldn't happen, but the application officer 1707 # might have forgotten to lock the form after changing the state 1694 1708 self.flash(_('This form cannot be submitted. Wrong state!')) 1695 1709 return -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r9011 r9021 922 922 self.assertTrue('clearance started' in self.browser.contents) 923 923 self.browser.open(self.history_path) 924 self.assertTrue("Reset to 'clearance ' by My Public Name" in924 self.assertTrue("Reset to 'clearance started' by My Public Name" in 925 925 self.browser.contents) 926 926 IWorkflowInfo(self.student).fireTransition('request_clearance') … … 1304 1304 self.assertEqual(self.student.state, 'courses registered') 1305 1305 return 1306 1307 def test_student_clearance_wo_clrcode(self): 1308 IWorkflowState(self.student).setState('clearance started') 1309 self.browser.open(self.login_path) 1310 self.browser.getControl(name="form.login").value = self.student_id 1311 self.browser.getControl(name="form.password").value = 'spwd' 1312 self.browser.getControl("Login").click() 1313 self.student.clearance_locked = False 1314 self.browser.open(self.edit_clearance_path) 1315 self.browser.getControl(name="form.date_of_birth").value = '09/10/1961' 1316 self.browser.getControl("Save and request clearance").click() 1317 self.assertMatches('...Clearance has been requested...', 1318 self.browser.contents) 1306 1319 1307 1320 def test_manage_payments(self):
Note: See TracChangeset for help on using the changeset viewer.