Changeset 11622 for main/waeup.aaue/trunk/src
- Timestamp:
- 6 May 2014, 06:20:46 (11 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/etranzact/tests.py
r11554 r11622 55 55 IWorkflowState(self.student).setState('cleared') 56 56 self.browser.open(self.payments_path + '/addop') 57 self.browser.getControl(name="form.p_category").value = ['clearance'] 58 self.browser.getControl("Create ticket").click() 59 self.assertMatches('...ticket created...', 60 self.browser.contents) 61 ctrl = self.browser.getControl(name='val_id') 62 value = ctrl.options[0] 63 self.student['payments'][value].approve() 64 65 self.browser.open(self.payments_path + '/addop') 57 66 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 58 67 self.browser.getControl("Create ticket").click() 59 68 self.assertMatches('...ticket created...', 60 69 self.browser.contents) 61 62 70 ctrl = self.browser.getControl(name='val_id') 63 value = ctrl.options[ 0]71 value = ctrl.options[1] 64 72 self.p_id = value 65 73 self.browser.getLink(value).click() -
main/waeup.aaue/trunk/src/waeup/aaue/students/payments.py
r9990 r11622 26 26 StudentOnlinePayment, StudentOnlinePaymentFactory) 27 27 from waeup.kofa.utils.helpers import attrs_to_fields 28 from waeup.kofa.accesscodes import create_accesscode 28 29 from waeup.aaue.students.interfaces import ICustomStudentOnlinePayment 29 30 … … 43 44 return 44 45 45 @property 46 def student(self): 47 return self.__parent__.__parent__ 46 def _createActivationCodes(self): 47 student = self.student 48 if self.p_category in ('schoolfee', 'schoolfee_1'): 49 # Create SFE access code 50 pin, error = create_accesscode( 51 'SFE',0,self.amount_auth,student.student_id) 52 if error: 53 return error 54 self.ac = pin 55 elif self.p_category == 'bed_allocation': 56 # Create HOS access code 57 pin, error = create_accesscode( 58 'HOS',0,self.amount_auth,student.student_id) 59 if error: 60 return error 61 self.ac = pin 62 elif self.p_category == 'transcript': 63 # Create TSC access code 64 pin, error = create_accesscode( 65 'TSC',0,self.amount_auth,student.student_id) 66 if error: 67 return error 68 self.ac = pin 69 return None 48 70 49 71 CustomStudentOnlinePayment = attrs_to_fields( -
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py
r11621 r11622 136 136 self.app['configuration']['2004'].school_fee = 6666.0 137 137 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 138 self.browser.getControl("Create ticket").click() 139 self.assertMatches('...ticket created...', 140 self.browser.contents) 138 # Accepotance fee must be paid first 139 self.browser.getControl("Create ticket").click() 140 self.assertMatches('...Please pay acceptance fee first...', 141 self.browser.contents) 142 self.app['configuration']['2004'].clearance_fee = 666.0 143 self.browser.getControl(name="form.p_category").value = ['clearance'] 144 self.browser.getControl("Create ticket").click() 141 145 ctrl = self.browser.getControl(name='val_id') 142 146 value = ctrl.options[0] 147 self.student['payments'][value].approveStudentPayment() 148 self.browser.open(self.payments_path + '/addop') 149 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 150 self.browser.getControl("Create ticket").click() 151 self.assertMatches('...ticket created...', 152 self.browser.contents) 153 ctrl = self.browser.getControl(name='val_id') 154 value = ctrl.options[1] 143 155 self.browser.getLink(value).click() 144 156 self.assertMatches('...Amount Authorized...', 145 157 self.browser.contents) 146 # Managers can open payment slip158 # Managers can open school fee payment slip 147 159 self.browser.getLink("Download payment slip").click() 148 160 self.assertEqual(self.browser.headers['Status'], '200 Ok') 149 161 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 150 162 # Set ticket paid 151 ticket = self.student['payments'].items()[0][1] 152 ticket.p_state = 'paid' 163 ticket = self.student['payments'][value].approveStudentPayment() 153 164 self.browser.open(self.payments_path + '/addop') 154 165 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 155 166 self.browser.getControl("Create ticket").click() 156 167 self.assertMatches('...This type of payment has already been made...', 157 self.browser.contents)158 self.browser.open(self.payments_path + '/addop')159 self.browser.getControl(name="form.p_category").value = ['clearance']160 self.browser.getControl("Create ticket").click()161 self.assertMatches('...ticket created...',162 168 self.browser.contents) 163 169 -
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_utils.py
r11621 r11622 56 56 57 57 IWorkflowState(self.student).setState('cleared') 58 error, payment = utils.setPaymentDetails('schoolfee',self.student) 59 # Acceptance fee must be paid first. 60 self.assertEqual(error, 'Please pay acceptance fee first.') 61 payment = createObject('waeup.StudentOnlinePayment') 62 payment.p_category = 'clearance' 63 self.student['payments']['any_id'] = payment 64 payment.approveStudentPayment() 65 # No activation code created. 66 self.assertEqual(payment.ac, None) 67 # School fee can be set. 58 68 error, payment = utils.setPaymentDetails('schoolfee',self.student) 59 69 self.assertEqual(payment.p_level, 100) -
main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py
r11620 r11622 109 109 new_session = student['studycourse'].current_session + 1 110 110 return new_session, new_level 111 112 def _acceptanceFeePaid(self, student): 113 if len(student['payments']): 114 for ticket in student['payments'].values(): 115 if ticket.p_state == 'paid' and \ 116 ticket.p_category == 'clearance': 117 return True 118 return False 111 119 112 120 def setPaymentDetails(self, category, student, … … 151 159 return _('Study course data are incomplete.'), None 152 160 if student.state == CLEARED: 161 if not self._acceptanceFeePaid(student): 162 return _('Please pay acceptance fee first.'), None 153 163 if student.faccode == 'FP': 154 164 amount = 84000.0
Note: See TracChangeset for help on using the changeset viewer.