Changeset 9325 for main/waeup.kofa/trunk/src/waeup
- Timestamp:
- 10 Oct 2012, 20:44:33 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_vocabularies.py
r9135 r9325 37 37 self.assertEqual(values, [100, 110, 120, 200, 210, 220, 300, 310, 320, 38 38 400, 410, 420, 500, 510, 520, 600, 610, 620]) 39 # All titles do exist 40 titles = [studylevelsource.getTitle(studycourse, value) 41 for value in values] 42 self.assertEqual(len(titles), 18) 39 43 # Unfortunately, unittests don't know about internationalization 40 44 self.assertEqual(studylevelsource.getTitle(studycourse, None), … … 62 66 self.assertEqual(studylevelsource.getTitle(studycourse, 700), 63 67 'Error: level id ${value} out of range') 64 # Now we change the certificates start_level to pre-studies 68 # Now we modify the certificates to be a pure to pre-studies 69 # course 65 70 studycourse.certificate.start_level = 10 71 studycourse.certificate.end_level = 10 72 values = studylevelsource.getValues(studycourse) 73 self.assertEqual(values, [10]) 74 titles = [studylevelsource.getTitle(studycourse, value) 75 for value in values] 76 self.assertEqual(len(titles), 1) 66 77 self.assertEqual(studylevelsource.getTitle(studycourse, 10), 67 78 'Pre-Studies') 68 # Repeating Pre-Studies level does not exist 79 # Finally we modify the certificate to be a mixed course, 80 # starting with pre-studies. 81 studycourse.certificate.end_level = 200 82 values = studylevelsource.getValues(studycourse) 83 self.assertEqual(values, [10, 100, 110, 120, 84 200, 210, 220, 300, 310, 320]) 85 titles = [studylevelsource.getTitle(studycourse, value) 86 for value in values] 87 self.assertEqual(len(titles), 10) 88 # Repeating Pre-Studies level does not exist and raises a KeyError 89 # when trying to get its title 69 90 self.assertRaises(KeyError,studylevelsource.getTitle,studycourse,20)
Note: See TracChangeset for help on using the changeset viewer.