Ignore:
Timestamp:
28 Oct 2018, 17:30:45 (6 years ago)
Author:
Henrik Bettermann
Message:

Implement study level 0 (Level Zero) option for storing for
orphaned course tickets (tickets without level information).
Add ticket_session field to ICourseTicket.

File:
1 edited

Legend:

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

    r9778 r15203  
    6565        studylevelsource = StudyLevelSource().factory
    6666        values = studylevelsource.getValues(studycourse)
    67         self.assertEqual(values, [100, 110, 120, 200, 210, 220, 300, 310, 320,
     67        self.assertEqual(values, [0, 100, 110, 120, 200, 210, 220, 300, 310, 320,
    6868            400, 410, 420, 500, 510, 520, 600, 610, 620])
    6969        # All titles do exist
    7070        titles = [studylevelsource.getTitle(studycourse, value)
    7171            for value in values]
    72         self.assertEqual(len(titles), 18)
     72        self.assertEqual(len(titles), 19)
    7373        # Unfortunately, unittests don't know about internationalization
    7474        self.assertEqual(studylevelsource.getTitle(studycourse, None),
    7575            'Error: level id ${value} out of range')
    7676        self.assertEqual(studylevelsource.getTitle(studycourse, 0),
     77            'Level Zero')
     78        self.assertEqual(studylevelsource.getTitle(studycourse, 1),
    7779            'Error: level id ${value} out of range')
    7880        self.assertEqual(studylevelsource.getTitle(studycourse, 10),
     
    9698        self.assertEqual(studylevelsource.getTitle(studycourse, 700),
    9799            'Error: level id ${value} out of range')
    98         # Now we modify the certificates to be a pure to pre-studies
     100        # Now we modify the certificates to be a pure pre-studies
    99101        # course
    100102        studycourse.certificate.start_level = 10
    101103        studycourse.certificate.end_level = 10
    102104        values = studylevelsource.getValues(studycourse)
    103         self.assertEqual(values, [10])
     105        self.assertEqual(values, [0, 10])
    104106        titles = [studylevelsource.getTitle(studycourse, value)
    105107            for value in values]
    106         self.assertEqual(len(titles), 1)
     108        self.assertEqual(len(titles), 2)
    107109        self.assertEqual(studylevelsource.getTitle(studycourse, 10),
    108110            'Pre-Studies')
     
    115117        studycourse.certificate.end_level = 200
    116118        values = studylevelsource.getValues(studycourse)
    117         self.assertEqual(values, [10, 100, 110, 120,
     119        self.assertEqual(values, [0, 10, 100, 110, 120,
    118120            200, 210, 220, 300, 310, 320])
    119121        titles = [studylevelsource.getTitle(studycourse, value)
    120122            for value in values]
    121         self.assertEqual(len(titles), 10)
     123        self.assertEqual(len(titles), 11)
    122124        # Repeating Pre-Studies level does not exist and raises a KeyError
    123125        # when trying to get its title
Note: See TracChangeset for help on using the changeset viewer.