Changeset 9386


Ignore:
Timestamp:
22 Oct 2012, 13:03:07 (12 years ago)
Author:
Henrik Bettermann
Message:

Extend tests for xml split data.

Location:
main/waeup.futminna/trunk/src/waeup/futminna/interswitch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.futminna/trunk/src/waeup/futminna/interswitch/browser.py

    r9292 r9386  
    227227            if self.context.student.current_mode == 'jm_ft':
    228228                xmldict['institution_acct'] = "000000000000"
    229                 xmldict['institution_bank_id'] = '0'
     229                xmldict['institution_bank_id'] = '00'
    230230            elif self.context.student.current_mode == 'pg_ft':
    231231                xmldict['institution_acct'] = "2522040000134"
     
    265265            self.pay_item_id = "11706"
    266266
    267         xmldict['institution_item_name'] = self.context.p_category
    268267        xmldict['institution_name'] = INSTITUTION_NAME
    269268        # Interswitch amount is not part of the xml data
     
    272271            xmltext = """<payment_item_detail>
    273272<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
    274 <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" />
     273<item_detail item_id="1" item_name="School Fee" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
    275274<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" />
    276275</item_details>
     
    279278            xmltext = """<payment_item_detail>
    280279<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
    281 <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" />
     280<item_detail item_id="1" item_name="Acceptance Fee" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
    282281</item_details>
    283282</payment_item_detail>""" % xmldict
  • main/waeup.futminna/trunk/src/waeup/futminna/interswitch/tests.py

    r9285 r9386  
    5050        IWorkflowState(self.student).setState('cleared')
    5151        self.browser.open(self.payments_path + '/addop')
     52        self.browser.getControl(name="form.p_category").value = ['schoolfee']
    5253        self.browser.getControl("Create ticket").click()
    5354        self.assertMatches('...Payment ticket created...',
    5455                           self.browser.contents)
     56
     57    def test_interswitch_form(self):
     58        # School fee ticket already created in setUp method
    5559        ctrl = self.browser.getControl(name='val_id')
    5660        value = ctrl.options[0]
     
    6367        self.payment_url = self.browser.url
    6468
    65     def test_interswitch_form(self):
    66 
    6769        # Manager can access InterswitchForm
    6870        self.browser.getLink("CollegePAY", index=0).click()
     71        # The total amount to be processed by Interswitch
     72        # has been reduced by the Interswitch fee of 150 Nairas
    6973        self.assertMatches('...Total Amount Authorized:...',
    7074                           self.browser.contents)
     
    7276            '...<input type="hidden" name="amount" value="13150000.0" />...',
    7377            self.browser.contents)
     78        self.assertMatches(
     79            '...item_name="School Fee" item_amt="12970000" bank_id="89" acct_num="0030001000017110"...',
     80            self.browser.contents)
     81        self.assertMatches(
     82            '...item_name="BT Education" item_amt="150000" bank_id="89" acct_num="0061001000021095"...',
     83            self.browser.contents)
     84
     85        # Create clearance fee ticket
     86        self.browser.open(self.payments_path + '/addop')
     87        self.browser.getControl(name="form.p_category").value = ['clearance']
     88        self.browser.getControl("Create ticket").click()
     89        self.assertMatches('...ticket created...',
     90                           self.browser.contents)
     91        ctrl = self.browser.getControl(name='val_id')
     92        value = ctrl.options[1]
     93        self.browser.getLink(value).click()
     94        self.assertMatches('...Amount Authorized...',
     95                           self.browser.contents)
     96        self.assertMatches(
     97            '...<span>20000.0</span>...',
     98            self.browser.contents)
     99        # Manager can access InterswitchForm
     100        self.browser.getLink("CollegePAY", index=0).click()
     101        self.assertMatches('...Total Amount Authorized:...',
     102                           self.browser.contents)
     103        # The total amount to be processed by Interswitch
     104        # has been reduced by the Interswitch fee of 150 Nairas
     105        self.assertMatches('...Total Amount Authorized:...',
     106                           self.browser.contents)
     107        self.assertMatches(
     108            '...<input type="hidden" name="amount" value="2000000.0" />...',
     109            self.browser.contents)
     110        self.assertMatches(
     111            '...item_name="Acceptance Fee" item_amt="1970000" bank_id="120" acct_num="1750005063"...',
     112            self.browser.contents)
     113        # BT does nor charge a fee for clearance
     114        self.assertFalse("BT Education" in self.browser.contents)
     115
    74116
    75117    @external_test
Note: See TracChangeset for help on using the changeset viewer.