Changeset 9869 for main


Ignore:
Timestamp:
12 Jan 2013, 07:01:41 (12 years ago)
Author:
Henrik Bettermann
Message:

Take new balance payment into consideration.

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

    r9796 r9869  
    9595        xmldict['institution_bank_id'] = '00'
    9696        xmldict['institution_amt'] = '0.0'
     97        provider_amt = 0.0
     98        self.pay_item_id = '0000'
    9799        if self.context.p_category == 'schoolfee':
    98             provider_amt = 1500.0
     100            if not self.context.p_item == 'Balance':
     101                provider_amt = 1500.0
    99102            if student.current_mode.endswith('_ft'):
    100103                self.pay_item_id = '5700'
     
    139142        elif self.context.p_category == 'gown':
    140143            self.pay_item_id = '5704'
    141             provider_amt = 0.0
    142144            xmldict['institution_bank_id'] = '7'
    143145            xmldict['institution_acct'] = '1016232382'
    144146        elif self.context.p_category.startswith('hostel_maintenance'):
    145147            self.pay_item_id = '5705'
    146             provider_amt = 0.0
    147148            xmldict['institution_bank_id'] = '129'
    148149            xmldict['institution_acct'] = '0014414547'
  • main/waeup.uniben/trunk/src/waeup/uniben/interswitch/tests.py

    r9863 r9869  
    258258            self.browser.contents)
    259259
    260 
     260        # Create balance payment ticket
     261        self.browser.open(self.payments_path + '/addbp')
     262        self.browser.getControl(name="form.p_category").value = ['schoolfee']
     263        self.browser.getControl(name="form.balance_session").value = ['2003']
     264        self.browser.getControl(name="form.balance_level").value = ['300']
     265        self.browser.getControl(name="form.balance_amount").value = '200'
     266        self.browser.getControl("Create ticket").click()
     267        ctrl = self.browser.getControl(name='val_id')
     268        value = ctrl.options[6]
     269        self.browser.getLink(value).click()
     270        self.assertMatches(
     271            '...<span>200.0</span>...',
     272            self.browser.contents)
     273        # Manager can access InterswitchForm
     274        self.browser.getLink("CollegePAY", index=0).click()
     275        self.assertEqual(self.student['payments'][value].provider_amt, 0.0)
     276        self.assertEqual(self.student['payments'][value].gateway_amt, 150.0)
     277        self.assertMatches('...<input type="hidden" name="pay_item_id" value="5701" />...',
     278                           self.browser.contents)
     279        self.assertMatches(
     280            '...<input type="hidden" name="amount" value="20000.0" />...',
     281            self.browser.contents)
     282        self.assertMatches(
     283            '...item_name="School Fee" item_amt="5000" bank_id="16" acct_num="0122009929"...',
     284            self.browser.contents)
     285        self.assertFalse(
     286            'item_name="BT Education"' in self.browser.contents)
    261287
    262288#    @external_test
Note: See TracChangeset for help on using the changeset viewer.