Changeset 8267 for main/waeup.uniben/trunk
- Timestamp:
- 24 Apr 2012, 21:30:43 (13 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/etranzact/browser.py
r8259 r8267 30 30 from waeup.uniben.applicants.interfaces import ICustomApplicantOnlinePayment 31 31 32 33 TERMINAL_ID = '0 500000003'34 QUERY_URL = 'https://www.etranzact.net/Query/queryPayoutletTransaction.jsp'35 32 #TERMINAL_ID = '0500000003' 33 TERMINAL_ID = '0000000001' 34 #QUERY_URL = 'https://www.etranzact.net/Query/queryPayoutletTransaction.jsp' 35 QUERY_URL = 'http://demo.etranzact.com:8080/WebConnect/queryPayoutletTransaction.jsp' 36 36 37 37 def query_etranzact(confirmation_number, user, payment, view): -
main/waeup.uniben/trunk/src/waeup/uniben/etranzact/tests.py
r8020 r8267 18 18 from hurry.workflow.interfaces import IWorkflowState 19 19 from waeup.kofa.students.tests.test_browser import StudentsFullSetup 20 from waeup.kofa.applicants.tests.test_browser import ApplicantsFullSetup 21 from waeup.kofa.configuration import SessionConfiguration 20 22 from waeup.uniben.testing import FunctionalLayer 21 23 … … 24 26 # If you enable this, please make sure the external services 25 27 # do exist really and are not bothered by being spammed by a test programme. 26 EXTERNAL_TESTS = False28 EXTERNAL_TESTS = True 27 29 28 30 def external_test(func): … … 36 38 return func 37 39 38 class EtranzactTests (StudentsFullSetup):40 class EtranzactTestsStudent(StudentsFullSetup): 39 41 """Tests for the eTranzact payment gateway. 40 42 """ … … 45 47 46 48 def setUp(self): 47 super(EtranzactTests , self).setUp()49 super(EtranzactTestsStudent, self).setUp() 48 50 # Managers can add online payment tickets 49 51 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') … … 72 74 self.browser.open(self.payment_url + '/query_history?confirmation_number=%s' 73 75 % self.CONFIRMATION_NO) 74 self.assertMatches('... Wrong amount...',76 self.assertMatches('...Invalid or unsuccessful callback:...', 75 77 self.browser.contents) 78 #self.assertMatches('...Wrong amount...', 79 # self.browser.contents) 80 #self.student['payments'][value].amount_auth = self.student[ 81 # 'payments'][value].r_amount_approved 82 #self.browser.open(self.payment_url + '/query_history?confirmation_number=%s' 83 # % self.CONFIRMATION_NO) 84 #self.assertMatches('...Wrong transaction id...', 85 # self.browser.contents) 76 86 77 self.student['payments'][value].amount_auth = self.student[ 78 'payments'][value].r_amount_approved 87 class EtranzactTestsApplicants(ApplicantsFullSetup): 88 """Tests for the Interswitch payment gateway. 89 """ 90 91 layer = FunctionalLayer 92 93 CONFIRMATION_NO = '500856521315472785095' 94 95 def setUp(self): 96 super(EtranzactTestsApplicants, self).setUp() 97 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 98 self.browser.open(self.manage_path) 99 #IWorkflowState(self.student).setState('started') 100 super(EtranzactTestsApplicants, self).fill_correct_values() 101 self.browser.getControl(name="transition").value = ['start'] 102 self.browser.getControl("Save").click() 103 self.browser.getControl("Add online").click() 104 self.assertTrue( 105 'Session configuration object is not available' 106 in self.browser.contents) 107 configuration = SessionConfiguration() 108 configuration.academic_session = 2009 109 configuration.application_fee = 1000.0 110 self.app['configuration'].addSessionConfiguration(configuration) 111 self.browser.getControl("Add online").click() 112 self.assertMatches('...ticket created...', 113 self.browser.contents) 114 ctrl = self.browser.getControl(name='val_id') 115 value = ctrl.options[0] 116 self.browser.getLink(value).click() 117 self.assertMatches('...Amount Authorized...', 118 self.browser.contents) 119 self.assertMatches( 120 '...<span>1000.0</span>...', 121 self.browser.contents) 122 self.payment_url = self.browser.url 123 124 @external_test 125 def test_etranzact_query_history(self): 126 79 127 self.browser.open(self.payment_url + '/query_history?confirmation_number=%s' 80 128 % self.CONFIRMATION_NO) 81 self.assertMatches('... Wrong transaction id...',129 self.assertMatches('...Invalid or unsuccessful callback:...', 82 130 self.browser.contents) 131 #self.assertMatches('...Wrong amount...', 132 # self.browser.contents) 133 #self.applicant[value].amount_auth = self.applicant[ 134 # value].r_amount_approved 135 #self.browser.open(self.payment_url + '/query_history?confirmation_number=%s' 136 # % self.CONFIRMATION_NO) 137 #self.assertMatches('...Wrong transaction id...', 138 # self.browser.contents) -
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
r8265 r8267 113 113 self.assertMatches('...First Sitting Record...', 114 114 self.browser.contents) 115 # Managers can open clearance slip of ug students 116 self.browser.open(self.student_path + '/clearance.pdf') 117 self.assertEqual(self.browser.headers['Status'], '200 Ok') 118 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 115 119 # There is no pg field in the clearance form 116 120 self.assertFalse('Second Higher Education Record' … … 125 129 self.assertMatches('...First Sitting Record...', 126 130 self.browser.contents) 131 # Managers can open clearance slip of pg students 132 self.browser.open(self.student_path + '/clearance.pdf') 133 self.assertEqual(self.browser.headers['Status'], '200 Ok') 134 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 127 135 128 136 def test_manage_payments(self): … … 150 158 self.assertMatches('...Amount Authorized...', 151 159 self.browser.contents) 160 # Managers can open payment slip 161 self.browser.getLink("Download payment slip").click() 162 self.assertEqual(self.browser.headers['Status'], '200 Ok') 163 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 152 164 # Set ticket paid 153 165 ticket = self.student['payments'].items()[0][1] … … 198 210 self.assertMatches('...Session configuration object is not...', 199 211 self.browser.contents) 212 213 def test_student_access(self): 214 # Students can edit clearance data 215 IWorkflowState(self.student).setState('cleared') 216 self.student.clearance_locked = False 217 self.browser.open(self.login_path) 218 self.browser.getControl(name="form.login").value = self.student_id 219 self.browser.getControl(name="form.password").value = 'spwd' 220 self.browser.getControl("Login").click() 221 # Student can view and edit clearance data 222 self.browser.getLink("Clearance Data").click() 223 self.browser.getLink("Edit").click() 224 self.assertTrue('Save' in self.browser.contents) 225 226
Note: See TracChangeset for help on using the changeset viewer.