Changeset 9204
- Timestamp:
- 19 Sep 2012, 13:59:39 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r9201 r9204 1255 1255 if error is not None: 1256 1256 self.flash(error) 1257 if ' Would you like' in error:1257 if 'previous session' in error: 1258 1258 self.redirect(self.url(self.context) + '/@@addpp') 1259 1259 return -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r9191 r9204 1599 1599 1600 1600 def test_student_previous_payments(self): 1601 configuration = createObject('waeup.SessionConfiguration') 1602 configuration.academic_session = 2000 1603 configuration.clearance_fee = 3456.0 1604 configuration.booking_fee = 123.4 1605 self.student['studycourse'].entry_session = 2002 1606 self.app['configuration'].addSessionConfiguration(configuration) 1607 configuration2 = createObject('waeup.SessionConfiguration') 1608 configuration2.academic_session = 2003 1609 configuration2.clearance_fee = 3456.0 1610 configuration2.booking_fee = 123.4 1611 self.student['studycourse'].entry_session = 2002 1612 self.app['configuration'].addSessionConfiguration(configuration2) 1601 1613 # Login 1602 1614 self.browser.open(self.login_path) … … 1621 1633 # Previous session payment form is provided 1622 1634 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 1635 self.browser.getControl(name="form.p_session").value = ['2000'] 1636 self.browser.getControl(name="form.p_level").value = ['300'] 1637 self.browser.getControl("Create ticket").click() 1638 self.assertMatches('...The previous session must not fall below...', 1639 self.browser.contents) 1640 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 1623 1641 self.browser.getControl(name="form.p_session").value = ['2004'] 1642 self.browser.getControl(name="form.p_level").value = ['300'] 1643 self.browser.getControl("Create ticket").click() 1644 self.assertMatches('...This is not a previous session...', 1645 self.browser.contents) 1646 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 1647 self.browser.getControl(name="form.p_session").value = ['2003'] 1624 1648 self.browser.getControl(name="form.p_level").value = ['300'] 1625 1649 self.browser.getControl("Create ticket").click() … … 1634 1658 1635 1659 # Payment session is properly set 1636 self.assertEqual(self.student['payments'][value].p_session, 200 4)1660 self.assertEqual(self.student['payments'][value].p_session, 2003) 1637 1661 self.assertEqual(self.student['payments'][value].p_level, 300) 1638 1662 -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r9191 r9204 328 328 return _('Study course data are incomplete.'), None 329 329 if previous_session: 330 if previous_session < student['studycourse'].entry_session: 331 return _('The previous session must not fall below ' 332 'your entry session.'), None 333 if previous_session > student['studycourse'].current_session - 1: 334 return _('This is not a previous session.'), None 330 335 if previous_level == 100: 331 336 amount = getattr(certificate, 'school_fee_1', 0.0)
Note: See TracChangeset for help on using the changeset viewer.