Ignore:
Timestamp:
4 Sep 2012, 07:09:29 (12 years ago)
Author:
Henrik Bettermann
Message:

Prepare for previous session payments but disable student payments completely. setPaymentDetails has to be written from the scratch.

File:
1 edited

Legend:

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

    r8619 r9155  
    5151        self.browser.open(self.payments_path + '/addop')
    5252        self.browser.getControl("Create ticket").click()
    53         self.assertMatches('...ticket created...',
     53        self.assertMatches('...Payment components not yet configured...',
    5454                           self.browser.contents)
    55         ctrl = self.browser.getControl(name='val_id')
    56         value = ctrl.options[0]
    57         self.browser.getLink(value).click()
    58         self.assertMatches('...Amount Authorized...',
    59                            self.browser.contents)
    60         self.assertMatches(
    61             '...<span>40000.0</span>...',
    62             self.browser.contents)
    63         self.payment_url = self.browser.url
    6455
    65 
    66 #    def callback_url(self, payment_url, resp, apprAmt):
    67 #        return payment_url + (
    68 #            '/isw_callback?echo=' +
    69 #            '&resp=%s' +
    70 #            '&desc=Something went wrong' +
    71 #            '&txnRef=p1331792385335' +
    72 #            '&payRef=' + '&retRef=' +
    73 #            '&cardNum=0' +
    74 #            '&apprAmt=%s' +
    75 #            '&url=http://xyz') % (resp, apprAmt)
    76 
    77     def test_interswitch_form(self):
    78 
    79         # Manager can access InterswitchForm
    80         self.browser.getLink("CollegePAY", index=0).click()
    81         self.assertMatches('...Total Amount Authorized:...',
    82                            self.browser.contents)
    83         # The total amount to be processed by Interswitch
    84         # has been reduced by the Interswitch fee of 150 Nairas
    85         self.assertMatches(
    86             '...<input type="hidden" name="amount" value="4000000.0" />...',
    87             self.browser.contents)
    88 
    89 #    @external_test
    90 #    def test_callback(self):
    91 
    92         # Manager can call callback manually
    93 #        self.browser.open(self.callback_url(self.payment_url, 'XX', '300'))
    94 #        self.assertMatches('...Unsuccessful callback: Something went wrong...',
    95 #                          self.browser.contents)
    96 #        self.assertMatches('...Failed...',
    97 #                           self.browser.contents)
    98 #        self.browser.open(self.payment_url + '/isw_callback')
    99 #        self.assertMatches('...Unsuccessful callback: Incomplete query string...',
    100 #                          self.browser.contents)
    101 #        self.assertMatches('...Failed...',
    102 #                           self.browser.contents)
    103 #        self.browser.open(self.callback_url(self.payment_url, '00', '300000'))
    104 #        self.assertMatches('...Wrong amount...',
    105 #                          self.browser.contents)
    106 #        self.browser.open(self.callback_url(self.payment_url, '00', '4000000'))
    107 #        self.assertMatches('...Valid callback received...',
    108 #                          self.browser.contents)
    109 
    110     @external_test
    111     def test_webservice(self):
    112 
    113         self.browser.open(self.payment_url + '/request_webservice')
    114         self.assertMatches('...Unsuccessful callback...',
    115                           self.browser.contents)
    116         # The payment is now in state failed
    117         self.assertMatches('...<span>Failed</span>...',
    118                           self.browser.contents)
    11956
    12057class InterswitchTestsApplicants(ApplicantsFullSetup):
Note: See TracChangeset for help on using the changeset viewer.