Changeset 9527


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

Adjust to changes made in base package.

Location:
main/waeup.aaue/trunk/src/waeup/aaue/students
Files:
1 added
2 edited

Legend:

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

    r9504 r9527  
    8585        self.app['configuration']['2004'].gown_fee = 150.0
    8686        self.app['configuration']['2004'].transfer_fee = 90.0
    87         #self.app['configuration']['2004'].clearance_fee = 120.0
    8887        self.app['configuration']['2004'].booking_fee = 150.0
    8988        self.app['configuration']['2004'].maint_fee = 180.0
     
    9291        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    9392        self.browser.open(self.payments_path)
    94         self.browser.getControl("Add online payment ticket").click()
     93        self.browser.getLink("Add current session payment ticket").click()
    9594        self.browser.getControl("Create ticket").click()
    9695        self.assertMatches('...Wrong state...',
     
    101100        self.assertMatches('...Amount could not be determined...',
    102101                           self.browser.contents)
    103 
    104102        self.app['configuration']['2004'].school_fee_base = 6666.0
    105 
    106         self.browser.getControl("Add online payment ticket").click()
    107103        self.browser.getControl("Create ticket").click()
    108104        self.assertMatches('...ticket created...',
     
    169165                           self.browser.contents)
    170166        # Ok, then we approve the first instalment ...
     167        self.browser.open(self.payments_path)
    171168        ctrl = self.browser.getControl(name='val_id')
    172169        p_id = ctrl.options[0]
     
    204201        del self.app['configuration']['2004']
    205202        self.browser.open(self.payments_path)
    206         self.browser.getControl("Add online payment ticket").click()
     203        self.browser.getLink("Add current session payment ticket").click()
    207204        self.browser.getControl("Create ticket").click()
    208205        self.assertMatches('...Session configuration object is not...',
    209206                           self.browser.contents)
     207
     208    def test_student_payments(self):
     209        # Login
     210        IWorkflowState(self.student).setState('returning')
     211        self.browser.open(self.login_path)
     212        self.browser.getControl(name="form.login").value = self.student_id
     213        self.browser.getControl(name="form.password").value = 'spwd'
     214        self.browser.getControl("Login").click()
     215        self.browser.open(self.student_path + '/payments')
     216        self.assertTrue(
     217          'Add current session payment ticket' in self.browser.contents)
     218        self.assertFalse(
     219          'Add previous session payment ticket' in self.browser.contents)
     220        return
    210221
    211222    def test_get_returning_data(self):
  • main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py

    r9154 r9527  
    6363        p_level = student['studycourse'].current_level
    6464        p_current = True
    65         session = str(p_session)
    66         try:
    67             academic_session = grok.getSite()['configuration'][session]
    68         except KeyError:
     65        academic_session = self._getSessionConfiguration(p_session)
     66        if academic_session == None:
    6967            return _(u'Session configuration object is not available.'), None
    7068        # Determine fee.
     
    9492            elif student.state == RETURNING or\
    9593                (student.is_postgrad and student.state == PAID):
     94                academic_session = self._getSessionConfiguration(p_session)
     95                if academic_session == None:
     96                    return _(u'Session configuration object is not available.'), None
    9697                if student.state == RETURNING:
    9798                    p_session, p_level = self.getReturningData(student)
Note: See TracChangeset for help on using the changeset viewer.