Changeset 9922 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 29 Jan 2013, 08:56:56 (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/tests/test_browser.py
r9895 r9922 39 39 from waeup.kofa.app import University 40 40 from waeup.kofa.payments.interfaces import IPaymentWebservice 41 from waeup.kofa.students.interfaces import IStudentsUtils 41 42 from waeup.kofa.students.student import Student 42 43 from waeup.kofa.students.studylevel import StudentStudyLevel … … 2661 2662 'Your personal data record is outdated.' in self.browser.contents) 2662 2663 2664 def test_setReturningData(self): 2665 utils = getUtility(IStudentsUtils) 2666 self.student['studycourse'].current_level = 600 2667 utils.setReturningData(self.student) 2668 # The new level exceeds the certificates end_level. 2669 # In this case current_level remains unchanged and no error is raised. 2670 self.assertEqual(self.student['studycourse'].current_level, 600) 2671 2663 2672 class StudentRequestPWTests(StudentsFullSetup): 2664 2673 # Tests for student registration -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r9917 r9922 25 25 from reportlab.lib.styles import getSampleStyleSheet 26 26 from reportlab.platypus import Paragraph, Image, Table, Spacer 27 from zope.schema.interfaces import ConstraintNotSatisfied 27 28 from zope.component import getUtility, createObject 28 29 from zope.formlib.form import setUpEditWidgets … … 326 327 """ 327 328 new_session, new_level = self.getReturningData(student) 328 student['studycourse'].current_level = new_level 329 try: 330 student['studycourse'].current_level = new_level 331 except ConstraintNotSatisfied: 332 # Do not change level if level exceeds the 333 # certificate's end_level. 334 pass 329 335 student['studycourse'].current_session = new_session 330 336 verdict = student['studycourse'].current_verdict
Note: See TracChangeset for help on using the changeset viewer.