Ignore:
Timestamp:
11 Jan 2013, 09:20:16 (12 years ago)
Author:
Henrik Bettermann
Message:

Test also previous session payments.

File:
1 edited

Legend:

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

    r9831 r9863  
    226226            'item_name="BT Education"' in self.browser.contents)
    227227
     228        # Create previous session fee ticket
     229        configuration = createObject('waeup.SessionConfiguration')
     230        configuration.academic_session = 2003
     231        configuration.clearance_fee = 3456.0
     232        self.app['configuration'].addSessionConfiguration(configuration)
     233        self.student['studycourse'].entry_session = 2002
     234        self.browser.open(self.payments_path + '/addpp')
     235        self.browser.getControl(name="form.p_category").value = ['clearance']
     236        self.browser.getControl(name="form.p_session").value = ['2003']
     237        self.browser.getControl(name="form.p_level").value = ['300']
     238        self.browser.getControl("Create ticket").click()
     239        ctrl = self.browser.getControl(name='val_id')
     240        value = ctrl.options[5]
     241        self.browser.getLink(value).click()
     242        self.assertMatches(
     243            '...<span>45000.0</span>...',
     244            self.browser.contents)
     245        # Manager can access InterswitchForm
     246        self.browser.getLink("CollegePAY", index=0).click()
     247        self.assertEqual(self.student['payments'][value].provider_amt, 1500.0)
     248        self.assertEqual(self.student['payments'][value].gateway_amt, 150.0)
     249        self.assertMatches('...<input type="hidden" name="pay_item_id" value="5702" />...',
     250                           self.browser.contents)
     251        self.assertMatches('...Total Amount Authorized:...',
     252                           self.browser.contents)
     253        self.assertMatches(
     254            '...<input type="hidden" name="amount" value="4500000.0" />...',
     255            self.browser.contents)
     256        self.assertMatches(
     257            '...<item_detail item_id="1" item_name="Acceptance Fee" item_amt="4335000" bank_id="7" acct_num="1003475516" />...',
     258            self.browser.contents)
     259
     260
     261
    228262#    @external_test
    229263#    def test_callback(self):
Note: See TracChangeset for help on using the changeset viewer.