Changeset 13359 for main/waeup.aaue/trunk/src/waeup/aaue/students/tests
- Timestamp:
- 28 Oct 2015, 20:54:47 (9 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue/students/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py
r13353 r13359 462 462 self.assertEqual(self.browser.headers['Status'], '200 Ok') 463 463 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 464 path = os.path.join(samples_dir(), ' transcript.pdf')464 path = os.path.join(samples_dir(), 'matric_number_slip.pdf') 465 465 open(path, 'wb').write(self.browser.contents) 466 466 print "Sample PDF matric_number_slip.pdf written to %s" % path -
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_utils.py
r11653 r13359 116 116 utils = getUtility(IStudentsUtils) 117 117 site['configuration'].next_matric_integer = 1 118 site['configuration'].next_matric_integer_2 = 1 118 119 self.student.matric_number = None 119 # So far we don't set matric numbers of ft students.120 # Regular ft students have a matric number without leading constant. 120 121 msg, mnumber = utils.setMatricNumber(self.student) 121 self.assertEqual(msg, 'Matriculation number cannot be set.') 122 self.assertEqual(mnumber, None) 123 #self.assertEqual(msg, None) 124 #self.assertEqual(mnumber, 1) 125 #self.assertEqual(self.student.matric_number, 'fac1/dep1/04/00001') 126 #self.assertEqual(site['configuration'].next_matric_integer, 2) 127 # Part time have an extended matric number 122 self.assertEqual(self.student.matric_number, 'fac1/dep1/04/00001') 123 self.assertEqual(msg, None) 124 # Part time have an extended matric number with leading 'PTP' 125 # and a different counter which is next_matric_integer. 128 126 self.student.matric_number = None 129 127 self.student['studycourse'].certificate.study_mode = 'ug_pt' 130 128 msg, mnumber = utils.setMatricNumber(self.student) 131 129 self.assertEqual(self.student.matric_number, 'PTP/fac1/dep1/04/00001') 130 self.assertEqual(site['configuration'].next_matric_integer, 2) 131 # Students in faculty FBM an extended matric number with leading 'CMS' 132 # and the regular counter which is next_matric_integer_2. 133 self.app['faculties']['fac1'].code = 'FBM' 134 self.student['studycourse'].certificate.study_mode = 'ug_ft' 135 self.student.matric_number = None 136 msg, mnumber = utils.setMatricNumber(self.student) 137 self.assertEqual(self.student.matric_number, 'CMS/FBM/dep1/04/00002') 138 self.assertEqual(site['configuration'].next_matric_integer_2, 3) 132 139 # Foundation programme students don't get matric number. 133 140 self.student.matric_number = None
Note: See TracChangeset for help on using the changeset viewer.