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

Customize warnCreditsOOR.

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.