Ignore:
Timestamp:
4 Nov 2012, 19:59:50 (12 years ago)
Author:
Henrik Bettermann
Message:

Adjust to changes made in base package.

File:
1 edited

Legend:

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

    r9436 r9526  
    9595        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    9696        self.browser.open(self.payments_path)
    97         self.browser.getControl("Add online payment ticket").click()
     97        self.browser.getLink("Add current session payment ticket").click()
    9898        self.browser.getControl("Create ticket").click()
    9999        self.assertMatches('...Amount could not be determined...',
     
    166166        self.browser.getControl(name="form.p_category").value = ['schoolfee']
    167167        self.browser.getControl("Create ticket").click()
     168        # Uups, we forgot to add a session configuration for next session
     169        self.assertTrue('Session configuration object is not available.'
     170            in self.browser.contents)
     171        configuration = createObject('waeup.SessionConfiguration')
     172        configuration.academic_session = 2005
     173        self.app['configuration'].addSessionConfiguration(configuration)
     174        self.browser.getControl("Create ticket").click()
    168175        self.assertMatches('...ticket created...',
    169176                           self.browser.contents)
     
    176183                           self.browser.contents)
    177184
    178         # If the session configuration doesn't exist an error message will
    179         # be shown. No other requirement is being checked.
    180         del self.app['configuration']['2004']
    181         self.browser.open(self.payments_path)
    182         self.browser.getControl("Add online payment ticket").click()
    183         self.browser.getControl("Create ticket").click()
    184         self.assertMatches('...Session configuration object is not...',
    185                            self.browser.contents)
     185    def test_student_payments(self):
     186        # Login
     187        IWorkflowState(self.student).setState('returning')
     188        self.browser.open(self.login_path)
     189        self.browser.getControl(name="form.login").value = self.student_id
     190        self.browser.getControl(name="form.password").value = 'spwd'
     191        self.browser.getControl("Login").click()
     192        self.browser.open(self.student_path + '/payments')
     193        self.assertTrue(
     194          'Add current session payment ticket' in self.browser.contents)
     195        self.assertFalse(
     196          'Add previous session payment ticket' in self.browser.contents)
     197        return
    186198
    187199    def test_get_returning_data(self):
     
    220232
    221233        IWorkflowState(self.student).setState('returning')
     234        error, payment = utils.setPaymentDetails('schoolfee',self.student)
     235        self.assertEqual('Session configuration object is not available.', error)
     236        configuration = createObject('waeup.SessionConfiguration')
     237        configuration.academic_session = 2005
     238        self.app['configuration'].addSessionConfiguration(configuration)
    222239        error, payment = utils.setPaymentDetails('schoolfee',self.student)
    223240        self.assertEqual(payment.p_level, 200)
Note: See TracChangeset for help on using the changeset viewer.