Changeset 13390 for main/waeup.kwarapoly


Ignore:
Timestamp:
5 Nov 2015, 14:12:42 (9 years ago)
Author:
Henrik Bettermann
Message:

Set _p_changed when changing the counter dictionary. Start with 10.

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  
    547547        self.browser.open(self.student_path)
    548548        self.browser.getLink("Get Matriculation Number").click()
    549         self.assertTrue('Matriculation number ND/15/dep1/FT/001 assigned.'
     549        self.assertTrue('Matriculation number ND/15/dep1/FT/010 assigned.'
    550550            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})
    552554        self.assertRaises(
    553555            LinkNotFoundError,
     
    558560        logcontent = open(logfile).read()
    559561        self.assertTrue('W1000000 - waeup.kwarapoly.students.browser.StudentGetMatricNumberView - '
    560                         'W1000000 - ND/15/dep1/FT/001 assigned' in logcontent)
     562                        'W1000000 - ND/15/dep1/FT/010 assigned' in logcontent)
    561563        return
    562564
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/tests/test_utils.py

    r12911 r13390  
    5959        IWorkflowState(self.student).setState('school fee paid')
    6060        msg, mnumber = utils.setMatricNumber(self.student)
    61         self.assertEqual(self.student.matric_number, 'ND/15/dep1/FT/001')
     61        self.assertEqual(self.student.matric_number, 'ND/15/dep1/FT/010')
    6262        self.assertEqual(
    6363            self.app['faculties']['fac1']['dep1'].next_matric_dict,
    64             {2015: 2})
     64            {2015: 11})
    6565        # setting a new matric number in 2016, extends next_matric_dict
    6666        self.student['studycourse'].entry_session = 2016
     
    6969        self.assertEqual(
    7070            self.app['faculties']['fac1']['dep1'].next_matric_dict,
    71             {2015: 2, 2016: 2})
     71            {2015: 11, 2016: 11})
    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             {2015: 2, 2016: 3})
     77            {2015: 11, 2016: 12})
    7878        # matric number must not exist
    7979        msg, mnumber = utils.setMatricNumber(self.student)
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/utils.py

    r13389 r13390  
    328328            dep.next_matric_dict = {}
    329329        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
    332333            return
    333334        # increase counter value of entry_session
    334335        dep.next_matric_dict[entry_session] += 1
     336        dep._p_changed = True
    335337        return
    336338
     
    366368        dep = cert.__parent__.__parent__
    367369        next_integer = getattr(
    368             dep, 'next_matric_dict', {}).get(entry_session, 1)
     370            dep, 'next_matric_dict', {}).get(entry_session, 10)
    369371        entry_year = entry_session - 100*(entry_session/100)
    370372        matric_number = "%s/%s/%s/%s/%03d" % (
Note: See TracChangeset for help on using the changeset viewer.