Changeset 12980 for main/waeup.uniben/trunk/src
- Timestamp:
- 21 May 2015, 21:20:53 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/interswitch/tests.py
r12566 r12980 17 17 ## 18 18 import os 19 from datetime import datetime 19 from datetime import datetime, date, timedelta 20 20 from zope.component import createObject, getUtility 21 21 from zope.catalog.interfaces import ICatalog … … 321 321 # self.assertMatches('...Valid callback received...', 322 322 # self.browser.contents) 323 324 def test_interswitch_form_ticket_expired(self): 325 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 326 acc_payment = createObject('waeup.StudentOnlinePayment') 327 acc_payment.p_state = 'unpaid' 328 acc_payment.p_category = 'clearance' 329 acc_payment.p_id = 'xyz' 330 acc_payment.pay_item_id = '123' 331 acc_payment.amount_auth = 876.0 332 self.student['payments']['xyz'] = acc_payment 333 self.browser.open(self.payments_path + '/xyz') 334 self.browser.getLink("CollegePAY", index=0).click() 335 self.assertMatches('...<input type="hidden" name="pay_item_id" value="5702" />...', 336 self.browser.contents) 337 self.assertMatches('...Total Amount Authorized:...', 338 self.browser.contents) 339 self.assertEqual(self.student.current_mode, 'ug_ft') 340 self.assertMatches( 341 '...<input type="hidden" name="amount" value="87600" />...', 342 self.browser.contents) 343 delta = timedelta(minutes=61) 344 acc_payment.creation_date -= delta 345 self.browser.open(self.payments_path + '/xyz') 346 self.browser.getLink("CollegePAY", index=0).click() 347 self.assertMatches( 348 '...This payment ticket is too old. Please create a new ticket...', 349 self.browser.contents) 350 delta = timedelta(minutes=2) 351 acc_payment.creation_date += delta 352 self.browser.open(self.payments_path + '/xyz') 353 self.browser.getLink("CollegePAY", index=0).click() 354 self.assertMatches('...Total Amount Authorized:...', 355 self.browser.contents) 323 356 324 357 def test_pay_twice(self): … … 454 487 '...<input type="hidden" name="amount" value="100000" />...', 455 488 self.browser.contents) 489 delta = timedelta(minutes=61) 490 self.applicant.values()[0].creation_date -= delta 491 self.browser.open(self.payment_url) 492 self.browser.getLink("CollegePAY", index=0).click() 493 self.assertMatches( 494 '...This payment ticket is too old. Please create a new ticket...', 495 self.browser.contents) 456 496 457 497 @external_test
Note: See TracChangeset for help on using the changeset viewer.