Ignore:
Timestamp:
31 Jul 2018, 08:16:59 (6 years ago)
Author:
Henrik Bettermann
Message:

Irrespective of the CGPA of a student, if the He/She? has
3rd Extension, such student will be graduated with a "Pass".

Part 2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_utils.py

    r14958 r15095  
    2222from waeup.kofa.students.tests.test_browser import StudentsFullSetup
    2323from waeup.kofa.students.interfaces import IStudentsUtils
     24from waeup.kofa.students.studylevel import StudentStudyLevel
    2425from waeup.aaue.testing import FunctionalLayer
    2526
     
    250251        self.assertEqual(msg, 'No certificate assigned.')
    251252        return
     253
     254    def test_getClassFromCGPA(self):
     255        site = grok.getSite()
     256        utils = getUtility(IStudentsUtils)
     257        gpaclass, gpaboundary = utils.getClassFromCGPA(4.6, self.student)
     258        self.assertEqual(gpaclass, 5)
     259        self.assertEqual(gpaboundary, '1st Class Honours')
     260        self.certificate.study_mode = 'dp_ft'
     261        gpaclass, gpaboundary = utils.getClassFromCGPA(4.6, self.student)
     262        self.assertEqual(gpaclass, 4)
     263        self.assertEqual(gpaboundary, 'Distinction')
     264        studylevel = StudentStudyLevel()
     265        studylevel.level = 520
     266        self.student['studycourse'].addStudentStudyLevel(self.certificate,
     267            studylevel)
     268        gpaclass, gpaboundary = utils.getClassFromCGPA(4.6, self.student)
     269        self.assertEqual(gpaclass, 1)
     270        self.assertEqual(gpaboundary, 'Pass')
Note: See TracChangeset for help on using the changeset viewer.