Ignore:
Timestamp:
31 May 2013, 18:19:03 (12 years ago)
Author:
Henrik Bettermann
Message:

Improve test to get a more realistic transcript.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r10266 r10267  
    18201820        self.student['studycourse'].addStudentStudyLevel(
    18211821            self.certificate, studylevel)
    1822         # Add second course
     1822        studylevel2 = createObject(u'waeup.StudentStudyLevel')
     1823        studylevel2.level = 110
     1824        studylevel2.level_session = 2006
     1825        self.student['studycourse'].addStudentStudyLevel(
     1826            self.certificate, studylevel2)
     1827        # Add second course (COURSE has been added automatically)
    18231828        courseticket = createObject('waeup.CourseTicket')
    18241829        courseticket.code = 'ANYCODE'
     
    18291834        courseticket.dcode = u'ANYDCODE'
    18301835        courseticket.fcode = u'ANYFCODE'
    1831         self.student['studycourse']['100']['COURSE2'] = courseticket
     1836        self.student['studycourse']['110']['COURSE2'] = courseticket
    18321837        self.student['studycourse']['100']['COURSE1'].score = 55
    1833         self.assertEqual(self.student['studycourse']['100'].gpa, 3.57)
     1838        self.assertEqual(self.student['studycourse']['100'].gpa, 3.0)
     1839        self.assertEqual(self.student['studycourse']['110'].gpa, 4.0)
    18341840        # Get transcript data
    18351841        td = self.student['studycourse'].getTranscriptData()
    18361842        self.assertEqual(td[0][0]['level_key'], '100')
    1837         self.assertEqual(td[0][0]['sgpa'], 3.57)
     1843        self.assertEqual(td[0][0]['sgpa'], 3.0)
    18381844        self.assertEqual(td[0][0]['level'].level, 100)
    18391845        self.assertEqual(td[0][0]['level'].level_session, 2005)
    1840         self.assertEqual(td[0][0]['tickets_1'][0].code, 'ANYCODE')
    1841         self.assertEqual(td[0][0]['tickets_1'][1].code, 'COURSE1')
     1846        self.assertEqual(td[0][0]['tickets_1'][0].code, 'COURSE1')
     1847        self.assertEqual(td[0][1]['level_key'], '110')
     1848        self.assertEqual(td[0][1]['sgpa'], 4.0)
     1849        self.assertEqual(td[0][1]['level'].level, 110)
     1850        self.assertEqual(td[0][1]['level'].level_session, 2006)
     1851        self.assertEqual(td[0][1]['tickets_1'][0].code, 'ANYCODE')
    18421852        self.assertEqual(td[1], 3.57)
    18431853        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
Note: See TracChangeset for help on using the changeset viewer.