Ignore:
Timestamp:
5 Aug 2013, 06:37:46 (11 years ago)
Author:
Henrik Bettermann
Message:

Add new payment category.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r10279 r10449  
    190190        configuration.academic_session = 2004
    191191        configuration.clearance_fee = 3456.0
     192        configuration.transcript_fee = 4567.0
    192193        configuration.booking_fee = 123.4
    193194        configuration.maint_fee = 987.0
     
    980981        self.assertEqual(ac.owner, self.student_id)
    981982        self.assertEqual(ac.cost, 3456.0)
     983
     984        # Managers can add online transcript payment tickets
     985        self.browser.open(self.payments_path + '/addop')
     986        self.browser.getControl(name="form.p_category").value = ['transcript']
     987        self.browser.getControl("Create ticket").click()
     988        self.assertMatches('...ticket created...',
     989                           self.browser.contents)
     990
     991        # Managers can approve the payment
     992        self.assertEqual(len(self.app['accesscodes']['TSC-0']),0)
     993        ctrl = self.browser.getControl(name='val_id')
     994        value = ctrl.options[2] # The clearance payment is the third in the table
     995        self.browser.getLink(value).click()
     996        self.browser.open(self.browser.url + '/approve')
     997        self.assertMatches('...Payment approved...',
     998                          self.browser.contents)
     999        expected = '''...
     1000        <td>
     1001          <span>Paid</span>
     1002        </td>...'''
     1003        self.assertMatches(expected,self.browser.contents)
     1004        # The new CLR-0 pin has been created
     1005        self.assertEqual(len(self.app['accesscodes']['TSC-0']),1)
     1006        pin = self.app['accesscodes']['TSC-0'].keys()[0]
     1007        ac = self.app['accesscodes']['TSC-0'][pin]
     1008        self.assertEqual(ac.owner, self.student_id)
     1009        self.assertEqual(ac.cost, 4567.0)
    9821010        return
    9831011
Note: See TracChangeset for help on using the changeset viewer.