- Timestamp:
- 29 Feb 2016, 07:23:48 (9 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py
r13720 r13749 444 444 445 445 def test_set_matric_number(self): 446 payment = createObject('waeup.StudentOnlinePayment') 447 payment.p_category = u'concessional' 448 payment.p_id = u'anyid' 449 payment.p_state = u'paid' 450 self.student['payments']['anykey'] = payment 446 451 # Login as student 447 452 self.browser.open(self.login_path) -
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_utils.py
r13664 r13749 130 130 site['configuration'].next_matric_integer_3 = 1 131 131 self.student.matric_number = None 132 msg, mnumber = utils.setMatricNumber(self.student) 133 self.assertEqual(msg, 'Matriculation number cannot be set.') 134 payment = createObject('waeup.StudentOnlinePayment') 135 payment.p_category = u'concessional' 136 payment.p_id = u'anyid' 137 payment.p_state = u'paid' 138 self.student['payments']['anykey'] = payment 132 139 # Regular ft students have a matric number without leading constant. 133 140 msg, mnumber = utils.setMatricNumber(self.student) -
main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py
r13720 r13749 57 57 return 58 58 59 def _concessionalPaymentMade(self, student): 60 if len(student['payments']): 61 for ticket in student['payments'].values(): 62 if ticket.p_state == 'paid' and \ 63 ticket.p_category == 'concessional': 64 return True 65 return False 66 59 67 def constructMatricNumber(self, student): 60 68 faccode = student.faccode … … 67 75 if not student.state in (PAID, ) or not student.is_fresh or \ 68 76 student.current_mode == 'found': 77 return _('Matriculation number cannot be set.'), None 78 if student.current_mode not in ('mug_ft', 'mde_ft') and \ 79 not self._concessionalPaymentMade(student): 69 80 return _('Matriculation number cannot be set.'), None 70 81 if student.is_postgrad: -
main/waeup.aaue/trunk/src/waeup/aaue/utils/utils.py
r13638 r13749 105 105 'found': 'Foundation', 106 106 'transfer': 'Transfer', 107 'mug_ft': 'Undergraduate Full Time Merit List', 108 'mde_ft': 'Direct Entry Full Time Merit List', 107 109 } 108 110
Note: See TracChangeset for help on using the changeset viewer.