Changeset 15600 for main/kofacustom.nigeria
- Timestamp:
- 20 Sep 2019, 15:35:17 (5 years ago)
- Location:
- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/applicantsbrowser.py
r15599 r15600 25 25 from waeup.kofa.browser.layout import UtilityView, KofaPage 26 26 from waeup.kofa.browser.viewlets import ManageActionButton 27 from waeup.kofa.applicants.browser import OnlinePaymentDisplayFormPage as OPDPApplicant28 27 from kofacustom.nigeria.etranzact.helpers import ( 29 28 write_payments_log, process_response, query_history) 30 from kofacustom.nigeria.applicants.browser import NigeriaOnlinePaymentDisplayFormPage 29 from kofacustom.nigeria.applicants.browser import NigeriaOnlinePaymentDisplayFormPage as NOPDPApplicant 31 30 from kofacustom.nigeria.payments.interfaces import INigeriaOnlinePayment 32 31 from kofacustom.nigeria.applicants.interfaces import INigeriaApplicantOnlinePayment … … 48 47 grok.order(1) 49 48 grok.context(INigeriaOnlinePayment) 50 grok.view( OPDPApplicant)49 grok.view(NOPDPApplicant) 51 50 grok.require('waeup.payApplicant') 52 51 icon = 'actionicon_pay.png' … … 65 64 grok.order(2) 66 65 grok.context(INigeriaOnlinePayment) 67 grok.view( OPDPApplicant)66 grok.view(NOPDPApplicant) 68 67 grok.require('waeup.payApplicant') 69 68 icon = 'actionicon_call.png' … … 137 136 return 138 137 139 class EtranzactReceiveResponseApplicant(N igeriaOnlinePaymentDisplayFormPage):138 class EtranzactReceiveResponseApplicant(NOPDPApplicant): 140 139 """ View that receives the response from eTrantact payment gateway. 141 140 """ -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/tests.py
r15598 r15600 175 175 176 176 @external_test 177 def test_ views(self):177 def test_applicant_views(self): 178 178 # Manager can access eTranzact form 179 179 self.browser.getLink("Pay via eTranzact").click() … … 191 191 return 192 192 193 193 class EtranzactTestsStudents(StudentsFullSetup): 194 """Tests for the Etranzact payment gateway. 195 """ 196 197 layer = FunctionalLayer 198 199 def setUp(self): 200 super(EtranzactTestsStudents, self).setUp() 201 self.app['configuration']['2004'].etranzact_enabled = True 202 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 203 self.browser.open(self.payments_path) 204 IWorkflowState(self.student).setState('cleared') 205 self.student.nationality = u'NG' 206 self.browser.open(self.payments_path + '/addop') 207 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 208 self.browser.getControl("Create ticket").click() 209 self.assertMatches('...ticket created...', 210 self.browser.contents) 211 ctrl = self.browser.getControl(name='val_id') 212 self.value = ctrl.options[0] 213 self.browser.getLink(self.value).click() 214 self.assertMatches('...Amount Authorized...', 215 self.browser.contents) 216 self.assertTrue('<span>40000.0</span>', self.browser.contents) 217 self.payment_url = self.browser.url 218 self.payment = self.student['payments'][self.value] 219 220 221 @external_test 222 def test_student_views(self): 223 # Manager can access eTranzact form 224 self.browser.getLink("Pay via eTranzact").click() 225 self.assertTrue("Pay now" in self.browser.contents) 226 # Means of testing end here. 227 # We requery an existing paiment now. 228 self.payment.p_id = TID 229 self.browser.open(self.payment_url) 230 self.browser.getLink("Requery eTranzact History").click() 231 self.assertTrue('Wrong checksum.' in self.browser.contents) 232 # ... probably because responseurl and amount stored in the 233 # system and the responseurl generated in process_response are 234 # different 235 # Means of testing end here again. 236 return
Note: See TracChangeset for help on using the changeset viewer.