Changeset 12911
- Timestamp:
- 7 May 2015, 08:41:01 (10 years ago)
- Location:
- main/waeup.kwarapoly/trunk/src/waeup/kwarapoly
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/tests/test_browser.py
r12907 r12911 525 525 self.student['studycourse']['200']['COURSE1'].course.credits, 100000) 526 526 self.browser.getControl("Register course list").click() 527 self.assertTrue('Course list has been registered' in self.browser.contents) 527 self.assertTrue( 528 'Course list has been registered' in self.browser.contents) 528 529 self.assertEqual(self.student.state, 'courses registered') 529 530 return … … 544 545 self.student['studycourse'].entry_session = 2014 545 546 self.browser.open(self.student_path) 547 self.assertRaises( 548 LinkNotFoundError, 549 self.browser.getLink, 'Get Matriculation Number') 550 self.student['studycourse'].entry_session = 2015 551 self.browser.open(self.student_path) 546 552 self.browser.getLink("Get Matriculation Number").click() 547 self.assertTrue('Matriculation number ND/1 4/dep1/FT/001 assigned.'553 self.assertTrue('Matriculation number ND/15/dep1/FT/001 assigned.' 548 554 in self.browser.contents) 549 self.assertEqual(self.student.matric_number, 'ND/1 4/dep1/FT/001')555 self.assertEqual(self.student.matric_number, 'ND/15/dep1/FT/001') 550 556 self.assertRaises( 551 557 LinkNotFoundError, … … 556 562 logcontent = open(logfile).read() 557 563 self.assertTrue('W1000000 - waeup.kwarapoly.students.browser.StudentGetMatricNumberPage - ' 558 'W1000000 - ND/1 4/dep1/FT/001 assigned' in logcontent)559 return 564 'W1000000 - ND/15/dep1/FT/001 assigned' in logcontent) 565 return -
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/tests/test_utils.py
r12907 r12911 51 51 self.student.matric_number = None 52 52 msg, mnumber = utils.setMatricNumber(self.student) 53 self.assertEqual(msg, 'Available from session 2015/2016') 54 self.student['studycourse'].entry_mode = 'nd_ft' 55 self.student['studycourse'].entry_session = 2015 56 msg, mnumber = utils.setMatricNumber(self.student) 57 self.assertEqual(mnumber, None) 53 58 self.assertEqual(msg, 'Wrong state.') 54 59 IWorkflowState(self.student).setState('school fee paid') 55 60 msg, mnumber = utils.setMatricNumber(self.student) 56 self.assertEqual(msg, 'Matriculation number cannot be set.') 57 self.assertEqual(mnumber, None) 58 self.student['studycourse'].entry_mode = 'nd_ft' 59 self.student['studycourse'].entry_session = 2013 60 msg, mnumber = utils.setMatricNumber(self.student) 61 self.assertEqual(self.student.matric_number, 'ND/13/dep1/FT/001') 61 self.assertEqual(self.student.matric_number, 'ND/15/dep1/FT/001') 62 62 self.assertEqual( 63 63 self.app['faculties']['fac1']['dep1'].next_matric_dict, 64 {201 3: 2})65 # setting a new matric number in 201 4, extends next_matric_dict66 self.student['studycourse'].entry_session = 201 464 {2015: 2}) 65 # setting a new matric number in 2016, extends next_matric_dict 66 self.student['studycourse'].entry_session = 2016 67 67 self.student.matric_number = None 68 68 msg, mnumber = utils.setMatricNumber(self.student) 69 69 self.assertEqual( 70 70 self.app['faculties']['fac1']['dep1'].next_matric_dict, 71 {201 3: 2, 2014: 2})71 {2015: 2, 2016: 2}) 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 {201 3: 2, 2014: 3})77 {2015: 2, 2016: 3}) 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
r12907 r12911 357 357 entry_mode = getattr( 358 358 student.get('studycourse', None), 'entry_mode', None) 359 if entry_session < 2015: 360 return _('Available from session 2015/2016'), None 359 361 if student.state not in (PAID, ): 360 362 return _('Wrong state.'), None -
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/university/tests.py
r12907 r12911 35 35 utils = getUtility(IStudentsUtils) 36 36 self.student.matric_number = None 37 self.student['studycourse'].entry_session = 2015 37 38 IWorkflowState(self.student).setState('school fee paid') 38 39 msg, mnumber = utils.setMatricNumber(self.student) … … 40 41 self.assertEqual(mnumber, None) 41 42 self.student['studycourse'].entry_mode = 'nd_ft' 42 self.student['studycourse'].entry_session = 201343 43 msg, mnumber = utils.setMatricNumber(self.student) 44 44 exporter = CustomDepartmentExporter() … … 49 49 'code,faculty_code,title,title_prefix,users_with_local_roles,' 50 50 'next_matric_dict\r\n' 51 'dep1,fac1,Unnamed Department,department,[],{201 3: 2}\r\n'51 'dep1,fac1,Unnamed Department,department,[],{2015: 2}\r\n' 52 52 ) 53 53 return
Note: See TracChangeset for help on using the changeset viewer.