Changeset 12911 for main/waeup.kwarapoly


Ignore:
Timestamp:
7 May 2015, 08:41:01 (10 years ago)
Author:
Henrik Bettermann
Message:

Matric number assignment is available only from session 2015/2016.

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  
    525525            self.student['studycourse']['200']['COURSE1'].course.credits, 100000)
    526526        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)
    528529        self.assertEqual(self.student.state, 'courses registered')
    529530        return
     
    544545        self.student['studycourse'].entry_session = 2014
    545546        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)
    546552        self.browser.getLink("Get Matriculation Number").click()
    547         self.assertTrue('Matriculation number ND/14/dep1/FT/001 assigned.'
     553        self.assertTrue('Matriculation number ND/15/dep1/FT/001 assigned.'
    548554            in self.browser.contents)
    549         self.assertEqual(self.student.matric_number, 'ND/14/dep1/FT/001')
     555        self.assertEqual(self.student.matric_number, 'ND/15/dep1/FT/001')
    550556        self.assertRaises(
    551557            LinkNotFoundError,
     
    556562        logcontent = open(logfile).read()
    557563        self.assertTrue('W1000000 - waeup.kwarapoly.students.browser.StudentGetMatricNumberPage - '
    558                         'W1000000 - ND/14/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  
    5151        self.student.matric_number = None
    5252        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)
    5358        self.assertEqual(msg, 'Wrong state.')
    5459        IWorkflowState(self.student).setState('school fee paid')
    5560        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')
    6262        self.assertEqual(
    6363            self.app['faculties']['fac1']['dep1'].next_matric_dict,
    64             {2013: 2})
    65         # setting a new matric number in 2014, extends next_matric_dict
    66         self.student['studycourse'].entry_session = 2014
     64            {2015: 2})
     65        # setting a new matric number in 2016, extends next_matric_dict
     66        self.student['studycourse'].entry_session = 2016
    6767        self.student.matric_number = None
    6868        msg, mnumber = utils.setMatricNumber(self.student)
    6969        self.assertEqual(
    7070            self.app['faculties']['fac1']['dep1'].next_matric_dict,
    71             {2013: 2, 2014: 2})
     71            {2015: 2, 2016: 2})
    7272        # setting a new matric number in 2014 again, increases the counter
    7373        self.student.matric_number = None
     
    7575        self.assertEqual(
    7676            self.app['faculties']['fac1']['dep1'].next_matric_dict,
    77             {2013: 2, 2014: 3})
     77            {2015: 2, 2016: 3})
    7878        # matric number must not exist
    7979        msg, mnumber = utils.setMatricNumber(self.student)
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/utils.py

    r12907 r12911  
    357357        entry_mode = getattr(
    358358            student.get('studycourse', None), 'entry_mode', None)
     359        if entry_session < 2015:
     360            return _('Available from session 2015/2016'), None
    359361        if student.state not in (PAID, ):
    360362            return _('Wrong state.'), None
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/university/tests.py

    r12907 r12911  
    3535        utils = getUtility(IStudentsUtils)
    3636        self.student.matric_number = None
     37        self.student['studycourse'].entry_session = 2015
    3738        IWorkflowState(self.student).setState('school fee paid')
    3839        msg, mnumber = utils.setMatricNumber(self.student)
     
    4041        self.assertEqual(mnumber, None)
    4142        self.student['studycourse'].entry_mode = 'nd_ft'
    42         self.student['studycourse'].entry_session = 2013
    4343        msg, mnumber = utils.setMatricNumber(self.student)
    4444        exporter = CustomDepartmentExporter()
     
    4949            'code,faculty_code,title,title_prefix,users_with_local_roles,'
    5050            'next_matric_dict\r\n'
    51             'dep1,fac1,Unnamed Department,department,[],{2013: 2}\r\n'
     51            'dep1,fac1,Unnamed Department,department,[],{2015: 2}\r\n'
    5252            )
    5353        return
Note: See TracChangeset for help on using the changeset viewer.