- Timestamp:
- 1 Nov 2019, 11:39:34 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/tests.py
r15730 r15734 32 32 from kofacustom.nigeria.students.payments import NigeriaStudentOnlinePayment 33 33 from kofacustom.nigeria.testing import FunctionalLayer 34 from kofacustom.nigeria.etranzact.helpers import query_history, query_payoutlet 34 from kofacustom.nigeria.etranzact.helpers import ( 35 query_history, query_payoutlet, ERROR_PART1, ERROR_PART2) 35 36 36 37 #from kofacustom.nigeria.etranzact.helpers import (query_etranzact) … … 269 270 self.assertEqual(self.payment.r_desc, 'Test Test Test-CLEARANCE -001-p5723474039401') 270 271 return 272 273 def test_webservice(self): 274 self.browser.open( 275 'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=SCHOOLFEE' 276 % self.payment.p_id) 277 self.assertEqual(self.browser.contents, 278 'PayeeName=Anna Tester~' 279 'Faculty=fac1~Department=dep1~' 280 'Level=100~ProgrammeType=CERT1~' 281 'StudyType=ug_ft~Session=2004/2005~' 282 'PayeeID=%s~' 283 'Amount=40000.0~FeeStatus=unpaid~' 284 'Semester=N/A~PaymentType=School Fee~' 285 'MatricNumber=234~Email=aa@aa.ng~' 286 'PhoneNumber=1234' % self.payment.p_id) 287 self.browser.open('http://localhost/app/feerequest') 288 self.assertEqual(self.browser.contents, ERROR_PART1 + 'Missing PAYEE_ID' + ERROR_PART2) 289 290 self.browser.open('http://localhost/app/feerequest?NONSENSE=nonsense') 291 self.assertEqual(self.browser.contents, ERROR_PART1 + 'Missing PAYEE_ID' + ERROR_PART2) 292 293 self.browser.open( 294 'http://localhost/app/feerequest?PAYEE_ID=nonsense&PAYMENT_TYPE=SCHOOLFEE') 295 self.assertEqual(self.browser.contents, ERROR_PART1 + 'Invalid PAYEE_ID' + ERROR_PART2) 296 297 self.browser.open( 298 'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=NONSENSE' 299 % self.payment.p_id) 300 self.assertEqual(self.browser.contents, ERROR_PART1 + 'Invalid PAYMENT_TYPE' + ERROR_PART2) 301 302 self.browser.open( 303 'http://localhost/app/feerequest?PAYEE_ID=%s' % self.payment.p_id) 304 self.assertEqual(self.browser.contents, ERROR_PART1 + 'Invalid PAYMENT_TYPE' + ERROR_PART2) 305 306 self.browser.open( 307 'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=CLEARANCE' 308 % self.payment.p_id) 309 self.assertEqual(self.browser.contents, ERROR_PART1 + 'Wrong PAYMENT_TYPE' + ERROR_PART2) 310 311 # Change payment state 312 self.student['payments'][self.payment.p_id].p_state = 'paid' 313 314 self.browser.open( 315 'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=SCHOOLFEE' 316 % self.payment.p_id) 317 self.assertEqual(self.browser.contents, ERROR_PART1 + 'PAYEE_ID already used' + ERROR_PART2)
Note: See TracChangeset for help on using the changeset viewer.