Ignore:
Timestamp:
13 Jan 2016, 09:16:36 (9 years ago)
Author:
Henrik Bettermann
Message:

Implement matric number constructor for pg students.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_utils.py

    r13594 r13609  
    128128        site['configuration'].next_matric_integer = 1
    129129        site['configuration'].next_matric_integer_2 = 1
     130        site['configuration'].next_matric_integer_3 = 1
    130131        self.student.matric_number = None
    131132        # Regular ft students have a matric number without leading constant.
     
    140141        self.assertEqual(self.student.matric_number, 'PTP/fac1/dep1/04/00001')
    141142        self.assertEqual(site['configuration'].next_matric_integer, 2)
    142         # Students in faculty FBM an extended matric number with leading 'CMS'
     143        # Students in faculty FBM get an extended matric number with leading 'CMS'
    143144        # and the regular counter which is next_matric_integer_2.
    144145        self.app['faculties']['fac1'].code = 'FBM'
     
    148149        self.assertEqual(self.student.matric_number, 'CMS/FBM/dep1/04/00002')
    149150        self.assertEqual(site['configuration'].next_matric_integer_2, 3)
     151        # PG Students get an extended matric number with leading 'AAU/SPS'
     152        # and the pg  counter which is next_matric_integer_3.
     153        self.app['faculties']['fac1'].code = 'ABC'
     154        self.student['studycourse'].certificate.study_mode = 'special_pg_ft'
     155        self.student.matric_number = None
     156        msg, mnumber = utils.setMatricNumber(self.student)
     157        self.assertEqual(self.student.matric_number, 'AAU/SPS/ABC/dep1/04/CERT1/00001')
     158        self.assertEqual(site['configuration'].next_matric_integer_3, 2)
    150159        # Foundation programme students don't get matric number.
    151160        self.student.matric_number = None
Note: See TracChangeset for help on using the changeset viewer.