Ignore:
Timestamp:
28 Nov 2013, 18:35:10 (11 years ago)
Author:
Henrik Bettermann
Message:

Fix test.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.ekodisco/trunk/src/kofacustom/ekodisco/interswitch/tests.py

    r10783 r10807  
    8282            self.browser.contents)
    8383        self.assertMatches(
    84             '...item_name="Not applicable" item_amt="4000000" bank_id="00" acct_num="00000000"...',
     84            '...item_name="Meter Charge" item_amt="4000000" bank_id="00" acct_num="00000000"...',
    8585            self.browser.contents)
    8686
     
    162162            '12000.0,00,0.0,150.0,0.0,,,\n'
    163163            in logcontent)
    164 
    165 
    166 class InterswitchTestsApplicants(ApplicantsFullSetup):
    167     """Tests for the Interswitch payment gateway.
    168     """
    169 
    170     layer = FunctionalLayer
    171 
    172     def setUp(self):
    173         super(InterswitchTestsApplicants, self).setUp()
    174         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    175         self.browser.open(self.manage_path)
    176         #IWorkflowState(self.student).setState('started')
    177         super(InterswitchTestsApplicants, self).fill_correct_values()
    178         self.applicantscontainer.application_fee = 1000.0
    179         self.browser.getControl(name="form.nationality").value = ['NG']
    180         self.browser.getControl(name="transition").value = ['start']
    181         self.browser.getControl("Save").click()
    182         self.browser.getControl("Add online").click()
    183         self.assertMatches('...ticket created...',
    184                            self.browser.contents)
    185         #ctrl = self.browser.getControl(name='val_id')
    186         #value = ctrl.options[0]
    187         #self.browser.getLink(value).click()
    188         self.assertMatches('...Amount Authorized...',
    189                            self.browser.contents)
    190         self.assertMatches(
    191             '...<span>1000.0</span>...',
    192             self.browser.contents)
    193         self.payment_url = self.browser.url
    194 
    195 
    196     def test_interswitch_form(self):
    197 
    198         # Manager can access InterswitchForm
    199         self.browser.getLink("CollegePAY", index=0).click()
    200         self.assertMatches('...Total Amount Authorized:...',
    201                            self.browser.contents)
    202         self.assertMatches(
    203             '...<input type="hidden" name="amount" value="100000.0" />...',
    204             self.browser.contents)
    205 
    206     @external_test
    207     def test_webservice(self):
    208 
    209         self.browser.open(self.payment_url + '/request_webservice')
    210         self.assertMatches('...Unsuccessful callback...',
    211                           self.browser.contents)
    212         # The payment is now in state failed
    213         self.assertMatches('...<span>Failed</span>...',
    214                           self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.