Changeset 7625 for main/waeup.sirp/trunk/src/waeup/sirp/students/tests
- Timestamp:
- 10 Feb 2012, 20:05:55 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_vocabularies.py
r7616 r7625 36 36 values = studylevelsource.getValues(studycourse) 37 37 self.assertEqual(values, [100, 110, 120, 200, 210, 220, 300, 310, 320, 38 400, 410, 420, 500, 510, 520, 600, 610]) 39 self.assertTrue(studylevelsource.getTitle(studycourse, 0), 38 400, 410, 420, 500, 510, 520, 600, 610, 620]) 39 self.assertEqual(studylevelsource.getTitle(studycourse, None), 40 'Error: level id None out of range') 41 self.assertEqual(studylevelsource.getTitle(studycourse, 0), 40 42 'Error: level id 0 out of range') 41 self.assert True(studylevelsource.getTitle(studycourse, 10),43 self.assertEqual(studylevelsource.getTitle(studycourse, 10), 42 44 'Error: level id 10 out of range') 43 self.assert True(studylevelsource.getTitle(studycourse, 100),45 self.assertEqual(studylevelsource.getTitle(studycourse, 100), 44 46 '100 (Year 1)') 45 self.assert True(studylevelsource.getTitle(studycourse, 110),46 '100 (Year 1) on 1 .probation')47 self.assert True(studylevelsource.getTitle(studycourse, 120),48 '100 (Year 1) on 2 .probation')49 self.assert True(studylevelsource.getTitle(studycourse, 500),47 self.assertEqual(studylevelsource.getTitle(studycourse, 110), 48 '100 (Year 1) on 1st probation') 49 self.assertEqual(studylevelsource.getTitle(studycourse, 120), 50 '100 (Year 1) on 2nd probation') 51 self.assertEqual(studylevelsource.getTitle(studycourse, 500), 50 52 '500 (Year 5)') 51 self.assert True(studylevelsource.getTitle(studycourse, 600),52 '500 (Year 5) spillover')53 self.assert True(studylevelsource.getTitle(studycourse, 610),53 self.assertEqual(studylevelsource.getTitle(studycourse, 600), 54 '500 (Year 5) 1st spillover') 55 self.assertEqual(studylevelsource.getTitle(studycourse, 610), 54 56 '500 (Year 5) 2nd spillover') 55 self.assertTrue(studylevelsource.getTitle(studycourse, 620), 56 'Error: level id 620 out of range') 57 self.assertTrue(studylevelsource.getTitle(studycourse, 900), 58 'Error: level id 900 out of range') 59 # Now we change the certificates start_level in order to include 60 # pre-studies 57 self.assertEqual(studylevelsource.getTitle(studycourse, 620), 58 '500 (Year 5) 3rd spillover') 59 self.assertEqual(studylevelsource.getTitle(studycourse, 630), 60 'Error: level id 630 out of range') 61 self.assertEqual(studylevelsource.getTitle(studycourse, 700), 62 'Error: level id 700 out of range') 63 # Now we change the certificates start_level to pre-studies 61 64 studycourse.certificate.start_level = 10 62 self.assert True(studylevelsource.getTitle(studycourse, 10),65 self.assertEqual(studylevelsource.getTitle(studycourse, 10), 63 66 'Pre-Studies') 67 # Repeating Pre-Studies level does not exist 68 self.assertRaises(KeyError,studylevelsource.getTitle,studycourse,20)
Note: See TracChangeset for help on using the changeset viewer.