Changeset 13390 for main/waeup.kwarapoly/trunk/src/waeup/kwarapoly
- Timestamp:
- 5 Nov 2015, 14:12:42 (9 years ago)
- Location:
- main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/tests/test_browser.py
r13389 r13390 547 547 self.browser.open(self.student_path) 548 548 self.browser.getLink("Get Matriculation Number").click() 549 self.assertTrue('Matriculation number ND/15/dep1/FT/0 01assigned.'549 self.assertTrue('Matriculation number ND/15/dep1/FT/010 assigned.' 550 550 in self.browser.contents) 551 self.assertEqual(self.student.matric_number, 'ND/15/dep1/FT/001') 551 self.assertEqual(self.student.matric_number, 'ND/15/dep1/FT/010') 552 self.assertEqual(self.app['faculties']['fac1']['dep1'].next_matric_dict, 553 {2015: 11}) 552 554 self.assertRaises( 553 555 LinkNotFoundError, … … 558 560 logcontent = open(logfile).read() 559 561 self.assertTrue('W1000000 - waeup.kwarapoly.students.browser.StudentGetMatricNumberView - ' 560 'W1000000 - ND/15/dep1/FT/0 01assigned' in logcontent)562 'W1000000 - ND/15/dep1/FT/010 assigned' in logcontent) 561 563 return 562 564 -
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/tests/test_utils.py
r12911 r13390 59 59 IWorkflowState(self.student).setState('school fee paid') 60 60 msg, mnumber = utils.setMatricNumber(self.student) 61 self.assertEqual(self.student.matric_number, 'ND/15/dep1/FT/0 01')61 self.assertEqual(self.student.matric_number, 'ND/15/dep1/FT/010') 62 62 self.assertEqual( 63 63 self.app['faculties']['fac1']['dep1'].next_matric_dict, 64 {2015: 2})64 {2015: 11}) 65 65 # setting a new matric number in 2016, extends next_matric_dict 66 66 self.student['studycourse'].entry_session = 2016 … … 69 69 self.assertEqual( 70 70 self.app['faculties']['fac1']['dep1'].next_matric_dict, 71 {2015: 2, 2016: 2})71 {2015: 11, 2016: 11}) 72 72 # setting a new matric number in 2014 again, increases the counter 73 73 self.student.matric_number = None … … 75 75 self.assertEqual( 76 76 self.app['faculties']['fac1']['dep1'].next_matric_dict, 77 {2015: 2, 2016: 3})77 {2015: 11, 2016: 12}) 78 78 # matric number must not exist 79 79 msg, mnumber = utils.setMatricNumber(self.student) -
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/utils.py
r13389 r13390 328 328 dep.next_matric_dict = {} 329 329 if not dep.next_matric_dict.get(entry_session, None): 330 # initialize counter element 331 dep.next_matric_dict[entry_session] = 2 330 # initialize counter element with 11 331 dep.next_matric_dict[entry_session] = 11 332 dep._p_changed = True 332 333 return 333 334 # increase counter value of entry_session 334 335 dep.next_matric_dict[entry_session] += 1 336 dep._p_changed = True 335 337 return 336 338 … … 366 368 dep = cert.__parent__.__parent__ 367 369 next_integer = getattr( 368 dep, 'next_matric_dict', {}).get(entry_session, 1 )370 dep, 'next_matric_dict', {}).get(entry_session, 10) 369 371 entry_year = entry_session - 100*(entry_session/100) 370 372 matric_number = "%s/%s/%s/%s/%03d" % (
Note: See TracChangeset for help on using the changeset viewer.