Changeset 15056 for main/kofacustom.edopoly/trunk/src
- Timestamp:
- 18 Jun 2018, 08:05:20 (7 years ago)
- Location:
- main/kofacustom.edopoly/trunk/src/kofacustom/edopoly
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/interswitch/tests.py
r15041 r15056 61 61 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 62 62 self.browser.getControl("Create ticket").click() 63 self.assertTrue( 64 'Pay SIWES, Logbook and ICT fees first.' in self.browser.contents) 65 66 # Add required payments first. 67 payment = createObject('waeup.StudentOnlinePayment') 68 payment.p_state = 'paid' 69 payment.p_category = 'ict_entre' 70 payment.p_id = '123' 71 payment.p_session = 2004 72 self.student['payments']['123'] = payment 73 payment = createObject('waeup.StudentOnlinePayment') 74 payment.p_state = 'paid' 75 payment.p_category = 'logbook_combo' 76 payment.p_id = '123' 77 payment.p_session = 2004 78 self.student['payments']['234'] = payment 79 payment = createObject('waeup.StudentOnlinePayment') 80 payment.p_state = 'paid' 81 payment.p_category = 'siwess_combo' 82 payment.p_id = '123' 83 payment.p_session = 2004 84 self.student['payments']['345'] = payment 85 86 self.browser.open(self.payments_path + '/addop') 87 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 88 self.browser.getControl("Create ticket").click() 63 89 self.assertMatches('...ticket created...', 64 90 self.browser.contents) 65 91 ctrl = self.browser.getControl(name='val_id') 66 self.value = ctrl.options[ 0]92 self.value = ctrl.options[3] 67 93 self.browser.getLink(self.value).click() 68 94 self.assertMatches('...Amount Authorized...', … … 88 114 self.browser.contents) 89 115 ctrl = self.browser.getControl(name='val_id') 90 self.value = ctrl.options[ 1]116 self.value = ctrl.options[4] 91 117 self.browser.getLink(self.value).click() 92 118 self.assertTrue( -
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/students/utils.py
r15035 r15056 87 87 return 'N/A' 88 88 89 def _requiredPaymentsMade(self, student, session): 90 if len(student['payments']): 91 num = 0 92 for ticket in student['payments'].values(): 93 if ticket.p_state == 'paid' and \ 94 ticket.p_category in ( 95 'ict_entre', 'logbook_combo', 'siwess_combo') and \ 96 ticket.p_session == session: 97 num += 1 98 if num == 3: 99 return True 100 return False 101 89 102 def setPaymentDetails(self, category, student, 90 103 previous_session, previous_level): … … 116 129 return _(u'Session configuration object is not available.'), None 117 130 # Determine fee. 131 # The following three fees are part of the school fee which must be 132 # paid before tuition fee. 133 if category in ('ict_entre', 'logbook_combo', 'siwess_combo') and \ 134 student.state == RETURNING: 135 p_session, p_level = self.getReturningData(student) 118 136 if category == 'schoolfee': 137 if not self._requiredPaymentsMade(student, p_session): 138 return _('Pay SIWES, Logbook and ICT fees first.'), None 119 139 try: 120 140 certificate = student['studycourse'].certificate
Note: See TracChangeset for help on using the changeset viewer.