Ignore:
Timestamp:
28 Nov 2012, 17:00:43 (12 years ago)
Author:
Henrik Bettermann
Message:

Use carryover categories only for calculation of fee, then change to schoolfee.

Configure SELECTABLE_PAYMENT_CATEGORIES.

Add and adjust tests.

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

Legend:

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

    r9725 r9737  
    241241        xmldict['dalash_amt'] = 0
    242242        self.pay_item_id = '000'
    243         if self.context.p_category in ('schoolfee', 'co1', 'co2', 'co3'):
     243        if self.context.p_category == 'schoolfee':
    244244            self.pay_item_id = '101'
    245245            # Dalash data
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/tests.py

    r9725 r9737  
    7979        IWorkflowState(self.student).setState('cleared')
    8080        self.browser.open(self.payments_path + '/addop')
     81        self.browser.getControl(name="form.p_category").value = ['schoolfee']
    8182        self.browser.getControl("Create ticket").click()
    8283        self.assertMatches('...ticket created...',
     
    154155        self.assertMatches('...Amount Authorized...',
    155156                           self.browser.contents)
    156 
    157157        # Maint fee is taken from the session configuration object
    158158        self.assertMatches(
     
    174174        self.assertMatches(
    175175            '...item_name="Hostel Maintenance Fee" item_amt="68700" bank_id="31" acct_num="0039050937"...',
     176            self.browser.contents)
     177
     178        # Create carryover ticket
     179        self.browser.open(self.payments_path + '/addop')
     180        self.browser.getControl(name="form.p_category").value = ['carryover1']
     181        self.browser.getControl("Create ticket").click()
     182        ctrl = self.browser.getControl(name='val_id')
     183        value = ctrl.options[2]
     184        self.browser.getLink(value).click()
     185        self.assertMatches(
     186            '...<span>6000.0</span>...',
     187            self.browser.contents)
     188        # Manager can access InterswitchForm
     189        self.browser.getLink("CollegePAY", index=0).click()
     190        self.assertMatches('...<input type="hidden" name="pay_item_id" value="101" />...',
     191                           self.browser.contents)
     192        self.assertMatches('...Total Amount Authorized:...',
     193                           self.browser.contents)
     194        self.assertMatches(
     195            '...<input type="hidden" name="amount" value="600000.0" />...',
     196            self.browser.contents)
     197        self.assertMatches(
     198            '...item_name="School Fee" item_amt="270000" bank_id="120" acct_num="1771180233"...',
     199            self.browser.contents)
     200        self.assertMatches(
     201            '...item_name="Dalash" item_amt="180000" bank_id="117" acct_num="1013196791"...',
     202            self.browser.contents)
     203        self.assertMatches(
     204            '...item_name="BT Education" item_amt="120000" bank_id="117" acct_num="1010764827"...',
    176205            self.browser.contents)
    177206
Note: See TracChangeset for help on using the changeset viewer.