Changeset 11593 for main/waeup.aaue/trunk/src/waeup/aaue/students/tests
- Timestamp:
- 22 Apr 2014, 20:52:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py
r11004 r11593 19 19 import shutil 20 20 import tempfile 21 import grok 21 22 from StringIO import StringIO 22 23 from hurry.workflow.interfaces import IWorkflowState … … 433 434 self.assertEqual(utils.maxCredits(dummy), 48) 434 435 return 436 437 def test_set_matric_number(self): 438 site = grok.getSite() 439 utils = getUtility(IStudentsUtils) 440 site['configuration'].next_matric_integer = 1 441 self.student.matric_number = None 442 msg, mnumber = utils.setMatricNumber(self.student) 443 self.assertEqual(msg, None) 444 self.assertEqual(mnumber, 1) 445 self.assertEqual(self.student.matric_number, 'fac1/dep1/04/00001') 446 self.assertEqual(site['configuration'].next_matric_integer, 2) 447 # Part time have an extended matric number 448 self.student.matric_number = None 449 self.student['studycourse'].certificate.study_mode = 'ug_pt' 450 msg, mnumber = utils.setMatricNumber(self.student) 451 self.assertEqual(self.student.matric_number, 'PTP/fac1/dep1/04/00002') 452 # Foundation programme students don't get matric number. 453 self.student.matric_number = None 454 self.student['studycourse'].certificate.study_mode = 'found' 455 msg, mnumber = utils.setMatricNumber(self.student) 456 self.assertEqual(msg, 'Matriculation number cannot be set.') 457 self.assertEqual(mnumber, None) 458 # Certificate must be set. 459 self.student.matric_number = None 460 self.student['studycourse'].certificate = None 461 msg, mnumber = utils.setMatricNumber(self.student) 462 self.assertEqual(msg, 'No certificate assigned.') 463 return
Note: See TracChangeset for help on using the changeset viewer.