Ignore:
Timestamp:
30 May 2019, 10:37:51 (5 years ago)
Author:
Henrik Bettermann
Message:

Customize warnCreditsOOR.

Location:
main/kofacustom.coewarri/trunk/src/kofacustom/coewarri/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.coewarri/trunk/src/kofacustom/coewarri/students/tests/test_utils.py

    r14658 r15443  
    6363        self.assertEqual(payment.amount_auth, 10300.0)
    6464        return
     65
     66    def test_warnCreditsOOR(self):
     67        self.student['studycourse'].entry_mode = 'ug_ft'
     68        studylevel = createObject(u'waeup.StudentStudyLevel')
     69        studylevel.level = 100
     70        studylevel.level_session = 2005
     71        self.student['studycourse'].addStudentStudyLevel(
     72            self.certificate, studylevel)
     73        studylevel['COURSE1'].credits = 48
     74        utils = getUtility(IStudentsUtils)
     75        error = utils.warnCreditsOOR(self.student['studycourse']['100'])
     76        self.assertFalse(error)
     77        studylevel['COURSE1'].credits = 49
     78        error = utils.warnCreditsOOR(studylevel)
     79        self.assertEqual(error, 'Maximum credits exceeded.')
     80        studylevel.level = 400
     81        error = utils.warnCreditsOOR(studylevel)
     82        self.assertFalse(error)
     83        return
  • main/kofacustom.coewarri/trunk/src/kofacustom/coewarri/students/utils.py

    r15439 r15443  
    7070        elif studylevel.student.current_mode == 'ug_ft':
    7171            limit = 48
     72            if studylevel.level == 400:
     73                limit = 51
    7274        else:
    7375            limit = 50
Note: See TracChangeset for help on using the changeset viewer.