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

Extend tests for xml split data.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.