Changeset 12979
- Timestamp:
- 21 May 2015, 20:57:55 (9 years ago)
- Location:
- main/kofacustom.skeleton/trunk/src/kofacustom/skeleton/interswitch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.skeleton/trunk/src/kofacustom/skeleton/interswitch/browser.py
r12511 r12979 60 60 61 61 def update(self): 62 super(CustomInterswitchPageStudent, self).update() 62 error = self.init_update() 63 if error: 64 self.flash(error, type='danger') 65 self.redirect(self.url(self.context, '@@index')) 66 return 63 67 student = self.student 64 68 xmldict = self.xmldict … … 120 124 121 125 def update(self): 122 super(CustomInterswitchPageApplicant, self).update() 126 error = self.init_update() 127 if error: 128 self.flash(error, type='danger') 129 self.redirect(self.url(self.context, '@@index')) 130 return 123 131 xmldict = {} 124 132 provider_amt = 400.0 -
main/kofacustom.skeleton/trunk/src/kofacustom/skeleton/interswitch/tests.py
r12479 r12979 83 83 '...item_name="School Fee" item_amt="4000000" bank_id="00" acct_num="00000000"...', 84 84 self.browser.contents) 85 86 def test_interswitch_form_ticket_expired(self): 87 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 88 acc_payment = createObject('waeup.StudentOnlinePayment') 89 acc_payment.p_state = 'unpaid' 90 acc_payment.p_category = 'clearance' 91 acc_payment.p_id = 'xyz' 92 acc_payment.pay_item_id = '123' 93 acc_payment.amount_auth = 876.0 94 self.student['payments']['xyz'] = acc_payment 95 self.browser.open(self.payments_path + '/xyz') 96 self.browser.getLink("CollegePAY", index=0).click() 97 self.assertMatches('...<input type="hidden" name="pay_item_id" value="0000" />...', 98 self.browser.contents) 99 self.assertMatches('...Total Amount Authorized:...', 100 self.browser.contents) 101 self.assertEqual(self.student.current_mode, 'ug_ft') 102 self.assertMatches( 103 '...<input type="hidden" name="amount" value="87600" />...', 104 self.browser.contents) 105 delta = timedelta(minutes=61) 106 acc_payment.creation_date -= delta 107 self.browser.open(self.payments_path + '/xyz') 108 self.browser.getLink("CollegePAY", index=0).click() 109 self.assertMatches( 110 '...This payment ticket is too old. Please create a new ticket...', 111 self.browser.contents) 112 delta = timedelta(minutes=2) 113 acc_payment.creation_date += delta 114 self.browser.open(self.payments_path + '/xyz') 115 self.browser.getLink("CollegePAY", index=0).click() 116 self.assertMatches('...Total Amount Authorized:...', 117 self.browser.contents) 85 118 86 119 @external_test … … 198 231 199 232 def test_interswitch_form(self): 200 201 233 # Manager can access InterswitchForm 202 234 self.browser.getLink("CollegePAY", index=0).click() … … 205 237 self.assertMatches( 206 238 '...<input type="hidden" name="amount" value="100000" />...', 239 self.browser.contents) 240 delta = timedelta(minutes=61) 241 self.applicant.values()[0].creation_date -= delta 242 self.browser.open(self.payment_url) 243 self.browser.getLink("CollegePAY", index=0).click() 244 self.assertMatches( 245 '...This payment ticket is too old. Please create a new ticket...', 207 246 self.browser.contents) 208 247
Note: See TracChangeset for help on using the changeset viewer.