Changeset 13111 for main/waeup.uniben/trunk/src/waeup/uniben
- Timestamp:
- 28 Jun 2015, 07:42:34 (10 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/interswitch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser.py
r12471 r13111 127 127 </item_details> 128 128 </payment_item_detail>""" % xmldict 129 elif self.context.p_category == 'schoolfee' and \ 130 student.current_mode == 'ug_ft': 131 xmldict['institution_amt'] = 100 * ( 132 self.context.amount_auth - provider_amt - GATEWAY_AMT - 3000) 133 xmltext = """<payment_item_detail> 134 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> 135 <item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" /> 136 <item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" /> 137 <item_detail item_id="3" item_name="T-SHIP" item_amt="100000" bank_id="72" acct_num="0061647254" /> 138 <item_detail item_id="4" item_name="MTN-NET LIBRARY" item_amt="200000" bank_id="8" acct_num="20177722298" /> 139 </item_details> 140 </payment_item_detail>""" % xmldict 129 141 else: 130 142 xmltext = """<payment_item_detail> -
main/waeup.uniben/trunk/src/waeup/uniben/interswitch/tests.py
r13016 r13111 66 66 self.assertMatches('...Amount Authorized...', 67 67 self.browser.contents) 68 self.assertMatches( 69 '...<span>40000.0</span>...', 70 self.browser.contents) 68 self.assertTrue( 69 '<span>40000.0</span>' in self.browser.contents) 71 70 self.payment_url = self.browser.url 72 71 … … 87 86 # The total amount to be processed by Interswitch 88 87 # has been reduced by the Interswitch fee of 150 Nairas 89 self.assert Matches('...<input type="hidden" name="pay_item_id" value="5700" />...',90 self.browser.contents)91 self.assert Matches('...Total Amount Authorized:...',92 self.browser.contents)88 self.assertTrue('<input type="hidden" name="pay_item_id" value="5700" />' 89 in self.browser.contents) 90 self.assertTrue('Total Amount Authorized:' 91 in self.browser.contents) 93 92 self.assertEqual(self.student.current_mode, 'ug_ft') 94 self.assertMatches( 95 '...<input type="hidden" name="amount" value="4000000" />...', 96 self.browser.contents) 97 self.assertMatches( 98 '...item_name="School Fee" item_amt="3835000" bank_id="8" acct_num="2017506430"...', 99 self.browser.contents) 100 self.assertMatches( 101 '...item_name="BT Education" item_amt="150000" bank_id="117" acct_num="1010764827"...', 102 self.browser.contents) 93 self.assertTrue( 94 '<input type="hidden" name="amount" value="4000000" />' 95 in self.browser.contents) 96 self.assertTrue( 97 'item_name="School Fee" item_amt="3535000" bank_id="8" acct_num="2017506430"' 98 in self.browser.contents) 99 self.assertTrue( 100 'item_name="BT Education" item_amt="150000" bank_id="117" acct_num="1010764827"' 101 in self.browser.contents) 102 self.assertTrue( 103 'item_name="T-SHIP" item_amt="100000" bank_id="72" acct_num="0061647254"' 104 in self.browser.contents) 105 self.assertTrue( 106 'item_name="MTN-NET LIBRARY" item_amt="200000" bank_id="8" acct_num="20177722298"' 107 in self.browser.contents) 103 108 104 109 # Create school fee ticket for returning students. Payment is made … … 133 138 self.assertEqual(self.student['payments'][value].provider_amt, 1500.0) 134 139 self.assertEqual(self.student['payments'][value].gateway_amt, 150.0) 135 self.assert Matches('...<input type="hidden" name="pay_item_id" value="5701" />...',136 self.browser.contents)137 self.assert Matches(138 ' ...<input type="hidden" name="amount" value="2000000" />...',139 self.browser.contents)140 self.assert Matches(141 ' ...item_name="School Fee" item_amt="1835000" bank_id="16" acct_num="0122009929"...',142 self.browser.contents)143 self.assert Matches(144 ' ...item_name="BT Education" item_amt="150000" bank_id="117" acct_num="1010764827"...',145 self.browser.contents)140 self.assertTrue('<input type="hidden" name="pay_item_id" value="5701" />' 141 in self.browser.contents) 142 self.assertTrue( 143 '<input type="hidden" name="amount" value="2000000" />' 144 in self.browser.contents) 145 self.assertTrue( 146 'item_name="School Fee" item_amt="1835000" bank_id="16" acct_num="0122009929"' 147 in self.browser.contents) 148 self.assertTrue( 149 'item_name="BT Education" item_amt="150000" bank_id="117" acct_num="1010764827"' 150 in self.browser.contents) 146 151 147 152 # Create clearance fee ticket … … 182 187 value = ctrl.options[2] 183 188 self.browser.getLink(value).click() 184 self.assert Matches(185 ' ...<span>234.0</span>...',189 self.assertTrue( 190 '<span>234.0</span>', 186 191 self.browser.contents) 187 192 # Manager can access InterswitchForm … … 189 194 self.assertEqual(self.student['payments'][value].provider_amt, 0.0) 190 195 self.assertEqual(self.student['payments'][value].gateway_amt, 150.0) 191 self.assert Matches('...<input type="hidden" name="pay_item_id" value="5704" />...',192 self.browser.contents)193 self.assert Matches('...Total Amount Authorized:...',194 self.browser.contents)195 self.assert Matches(196 ' ...<input type="hidden" name="amount" value="23400" />...',197 self.browser.contents)198 self.assert Matches(199 ' ...<item_detail item_id="1" item_name="Gown Hire Fee" item_amt="8400" bank_id="16" acct_num="0122011401" />...',200 self.browser.contents)196 self.assertTrue('<input type="hidden" name="pay_item_id" value="5704" />' 197 in self.browser.contents) 198 self.assertTrue('Total Amount Authorized:' 199 in self.browser.contents) 200 self.assertTrue( 201 '<input type="hidden" name="amount" value="23400" />' 202 in self.browser.contents) 203 self.assertTrue( 204 '<item_detail item_id="1" item_name="Gown Hire Fee" item_amt="8400" bank_id="16" acct_num="0122011401" />' 205 in self.browser.contents) 201 206 self.assertFalse( 202 207 'item_name="BT Education"' in self.browser.contents) … … 209 214 value = ctrl.options[3] 210 215 self.browser.getLink(value).click() 211 self.assertMatches( 212 '...<span>1000.0</span>...', 213 self.browser.contents) 216 self.assertTrue( 217 '<span>1000.0</span>' in self.browser.contents) 214 218 self.student['payments'][value].approve() 215 219 … … 221 225 value = ctrl.options[4] 222 226 self.browser.getLink(value).click() 223 self.assertMatches( 224 '...<span>8150.0</span>...', 225 self.browser.contents) 227 self.assertTrue( 228 '<span>8150.0</span>' in self.browser.contents) 226 229 # Manager can access InterswitchForm 227 230 self.browser.getLink("CollegePAY", index=0).click() 228 231 self.assertEqual(self.student['payments'][value].provider_amt, 0.0) 229 232 self.assertEqual(self.student['payments'][value].gateway_amt, 150.0) 230 self.assert Matches('...<input type="hidden" name="pay_item_id" value="5705" />...',231 233 self.assertTrue('<input type="hidden" name="pay_item_id" value="5705" />' 234 in self.browser.contents) 232 235 self.assertMatches('...Total Amount Authorized:...', 233 236 self.browser.contents) 234 self.assert Matches(235 ' ...<input type="hidden" name="amount" value="815000" />...',236 self.browser.contents)237 self.assert Matches(238 ' ...<item_detail item_id="1" item_name="Hostel Maintenance Fee" item_amt="800000" bank_id="129" acct_num="0014419432" />...',239 self.browser.contents)237 self.assertTrue( 238 '<input type="hidden" name="amount" value="815000" />' 239 in self.browser.contents) 240 self.assertTrue( 241 '<item_detail item_id="1" item_name="Hostel Maintenance Fee" item_amt="800000" bank_id="129" acct_num="0014419432" />' 242 in self.browser.contents) 240 243 self.assertFalse( 241 244 'item_name="BT Education"' in self.browser.contents) … … 283 286 value = ctrl.options[5] 284 287 self.browser.getLink(value).click() 285 self.assertMatches( 286 '...<span>200.0</span>...', 287 self.browser.contents) 288 self.assertTrue( 289 '<span>200.0</span>' in self.browser.contents) 288 290 # Manager can access InterswitchForm 289 291 self.browser.getLink("CollegePAY", index=0).click() 290 292 self.assertEqual(self.student['payments'][value].provider_amt, 0.0) 291 293 self.assertEqual(self.student['payments'][value].gateway_amt, 150.0) 292 self.assert Matches('...<input type="hidden" name="pay_item_id" value="5701" />...',293 self.browser.contents)294 self.assert Matches(295 ' ...<input type="hidden" name="amount" value="20000" />...',296 self.browser.contents)297 self.assert Matches(298 ' ...item_name="School Fee" item_amt="5000" bank_id="16" acct_num="0122009929"...',299 self.browser.contents)294 self.assertTrue('<input type="hidden" name="pay_item_id" value="5701" />' 295 in self.browser.contents) 296 self.assertTrue( 297 '<input type="hidden" name="amount" value="20000" />' 298 in self.browser.contents) 299 self.assertTrue( 300 'item_name="School Fee" item_amt="5000" bank_id="16" acct_num="0122009929"' 301 in self.browser.contents) 300 302 self.assertFalse( 301 303 'item_name="BT Education"' in self.browser.contents) … … 333 335 self.browser.open(self.payments_path + '/xyz') 334 336 self.browser.getLink("CollegePAY", index=0).click() 335 self.assert Matches('...<input type="hidden" name="pay_item_id" value="5702" />...',336 self.browser.contents)337 self.assert Matches('...Total Amount Authorized:...',338 self.browser.contents)337 self.assertTrue('<input type="hidden" name="pay_item_id" value="5702" />' 338 in self.browser.contents) 339 self.assertTrue('Total Amount Authorized:' 340 in self.browser.contents) 339 341 self.assertEqual(self.student.current_mode, 'ug_ft') 340 self.assert Matches(341 ' ...<input type="hidden" name="amount" value="87600" />...',342 self.browser.contents)342 self.assertTrue( 343 '<input type="hidden" name="amount" value="87600" />' 344 in self.browser.contents) 343 345 delta = timedelta(days=8) 344 346 acc_payment.creation_date -= delta … … 477 479 self.assertMatches('...Amount Authorized...', 478 480 self.browser.contents) 479 self.assertMatches( 480 '...<span>1000.0</span>...', 481 self.browser.contents) 481 self.assertTrue( 482 '<span>1000.0</span>' in self.browser.contents) 482 483 # Manager can access InterswitchForm 483 484 self.browser.getLink("CollegePAY", index=0).click() 484 485 self.assertMatches('...Total Amount Authorized:...', 485 486 self.browser.contents) 486 self.assert Matches(487 ' ...<input type="hidden" name="amount" value="100000" />...',488 self.browser.contents)487 self.assertTrue( 488 '<input type="hidden" name="amount" value="100000" />' 489 in self.browser.contents) 489 490 delta = timedelta(days=8) 490 491 self.applicant.values()[0].creation_date -= delta
Note: See TracChangeset for help on using the changeset viewer.