Ignore:
Timestamp:
28 Jun 2015, 07:42:34 (10 years ago)
Author:
Henrik Bettermann
Message:

Split school fee payments of ug_t students.

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  
    127127</item_details>
    128128</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
    129141        else:
    130142            xmltext = """<payment_item_detail>
  • main/waeup.uniben/trunk/src/waeup/uniben/interswitch/tests.py

    r13016 r13111  
    6666        self.assertMatches('...Amount Authorized...',
    6767                           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)
    7170        self.payment_url = self.browser.url
    7271
     
    8786        # The total amount to be processed by Interswitch
    8887        # has been reduced by the Interswitch fee of 150 Nairas
    89         self.assertMatches('...<input type="hidden" name="pay_item_id" value="5700" />...',
    90                            self.browser.contents)
    91         self.assertMatches('...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)
    9392        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)
    103108
    104109        # Create school fee ticket for returning students. Payment is made
     
    133138        self.assertEqual(self.student['payments'][value].provider_amt, 1500.0)
    134139        self.assertEqual(self.student['payments'][value].gateway_amt, 150.0)
    135         self.assertMatches('...<input type="hidden" name="pay_item_id" value="5701" />...',
    136                            self.browser.contents)
    137         self.assertMatches(
    138             '...<input type="hidden" name="amount" value="2000000" />...',
    139             self.browser.contents)
    140         self.assertMatches(
    141             '...item_name="School Fee" item_amt="1835000" bank_id="16" acct_num="0122009929"...',
    142             self.browser.contents)
    143         self.assertMatches(
    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)
    146151
    147152        # Create clearance fee ticket
     
    182187        value = ctrl.options[2]
    183188        self.browser.getLink(value).click()
    184         self.assertMatches(
    185             '...<span>234.0</span>...',
     189        self.assertTrue(
     190            '<span>234.0</span>',
    186191            self.browser.contents)
    187192        # Manager can access InterswitchForm
     
    189194        self.assertEqual(self.student['payments'][value].provider_amt, 0.0)
    190195        self.assertEqual(self.student['payments'][value].gateway_amt, 150.0)
    191         self.assertMatches('...<input type="hidden" name="pay_item_id" value="5704" />...',
    192                            self.browser.contents)
    193         self.assertMatches('...Total Amount Authorized:...',
    194                            self.browser.contents)
    195         self.assertMatches(
    196             '...<input type="hidden" name="amount" value="23400" />...',
    197             self.browser.contents)
    198         self.assertMatches(
    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)
    201206        self.assertFalse(
    202207            'item_name="BT Education"' in self.browser.contents)
     
    209214        value = ctrl.options[3]
    210215        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)
    214218        self.student['payments'][value].approve()
    215219
     
    221225        value = ctrl.options[4]
    222226        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)
    226229        # Manager can access InterswitchForm
    227230        self.browser.getLink("CollegePAY", index=0).click()
    228231        self.assertEqual(self.student['payments'][value].provider_amt, 0.0)
    229232        self.assertEqual(self.student['payments'][value].gateway_amt, 150.0)
    230         self.assertMatches('...<input type="hidden" name="pay_item_id" value="5705" />...',
    231                            self.browser.contents)
     233        self.assertTrue('<input type="hidden" name="pay_item_id" value="5705" />'
     234                         in self.browser.contents)
    232235        self.assertMatches('...Total Amount Authorized:...',
    233236                           self.browser.contents)
    234         self.assertMatches(
    235             '...<input type="hidden" name="amount" value="815000" />...',
    236             self.browser.contents)
    237         self.assertMatches(
    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)
    240243        self.assertFalse(
    241244            'item_name="BT Education"' in self.browser.contents)
     
    283286        value = ctrl.options[5]
    284287        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)
    288290        # Manager can access InterswitchForm
    289291        self.browser.getLink("CollegePAY", index=0).click()
    290292        self.assertEqual(self.student['payments'][value].provider_amt, 0.0)
    291293        self.assertEqual(self.student['payments'][value].gateway_amt, 150.0)
    292         self.assertMatches('...<input type="hidden" name="pay_item_id" value="5701" />...',
    293                            self.browser.contents)
    294         self.assertMatches(
    295             '...<input type="hidden" name="amount" value="20000" />...',
    296             self.browser.contents)
    297         self.assertMatches(
    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)
    300302        self.assertFalse(
    301303            'item_name="BT Education"' in self.browser.contents)
     
    333335        self.browser.open(self.payments_path + '/xyz')
    334336        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)
     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)
    339341        self.assertEqual(self.student.current_mode, 'ug_ft')
    340         self.assertMatches(
    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)
    343345        delta = timedelta(days=8)
    344346        acc_payment.creation_date -= delta
     
    477479        self.assertMatches('...Amount Authorized...',
    478480                           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)
    482483        # Manager can access InterswitchForm
    483484        self.browser.getLink("CollegePAY", index=0).click()
    484485        self.assertMatches('...Total Amount Authorized:...',
    485486                           self.browser.contents)
    486         self.assertMatches(
    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)
    489490        delta = timedelta(days=8)
    490491        self.applicant.values()[0].creation_date -= delta
Note: See TracChangeset for help on using the changeset viewer.