Changeset 9523


Ignore:
Timestamp:
4 Nov 2012, 10:27:40 (12 years ago)
Author:
Henrik Bettermann
Message:

Adjust to changes made in base package.

Location:
main/waeup.futminna/trunk/src/waeup/futminna/students
Files:
3 edited

Legend:

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

    r9431 r9523  
    151151        IWorkflowState(self.student).setState('returning')
    152152        error, payment = utils.setPaymentDetails('schoolfee',self.student)
     153        # Uups, we forgot to add a session configuration for next session
     154        self.assertEqual('Session configuration object is not available.', error)
     155        configuration = createObject('waeup.SessionConfiguration')
     156        configuration.academic_session = 2005
     157        self.app['configuration'].addSessionConfiguration(configuration)
     158
     159        error, payment = utils.setPaymentDetails('schoolfee',self.student)
    153160        self.assertEqual(payment.p_level, 200)
    154161        self.assertEqual(payment.p_session, 2005)
     
    238245                           self.browser.contents)
    239246        return
     247
     248    def test_student_payments(self):
     249        # Login
     250        self.browser.open(self.login_path)
     251        self.browser.getControl(name="form.login").value = self.student_id
     252        self.browser.getControl(name="form.password").value = 'spwd'
     253        self.browser.getControl("Login").click()
     254        self.browser.open(self.student_path + '/payments')
     255        self.assertTrue(
     256          'Add current session payment ticket' in self.browser.contents)
     257        self.assertFalse(
     258          'Add previous session payment ticket' in self.browser.contents)
     259        return
  • main/waeup.futminna/trunk/src/waeup/futminna/students/utils.py

    r9431 r9523  
    6868        p_level = student['studycourse'].current_level
    6969        p_current = True
    70         session = str(p_session)
    71         try:
    72             academic_session = grok.getSite()['configuration'][session]
    73         except KeyError:
     70        academic_session = self._getSessionConfiguration(p_session)
     71        if academic_session == None:
    7472            return _(u'Session configuration object is not available.'), None
     73        # Determine fee.
    7574        if category == 'schoolfee':
    7675            try:
     
    105104                    amount = 0.0
    106105            if student.state == RETURNING:
     106                # Override p_session and p_level
    107107                p_session, p_level = self.getReturningData(student)
     108                academic_session = self._getSessionConfiguration(p_session)
     109                if academic_session == None:
     110                    return _(u'Session configuration object is not available.'), None
    108111        elif category == 'clearance':
    109112            try:
  • main/waeup.futminna/trunk/src/waeup/futminna/students/viewlets.py

    r9242 r9523  
    2121    FileDisplay, FileUpload, Image)
    2222from waeup.kofa.students.browser import ExportPDFClearanceSlipPage
     23from waeup.kofa.students.viewlets import AddPreviousPaymentActionButton
    2324
    2425from kofacustom.nigeria.interfaces import MessageFactory as _
    2526
     27
     28class AddPreviousPaymentActionButton(AddPreviousPaymentActionButton):
     29
     30    @property
     31    def target_url(self):
     32        return ''
    2633
    2734# Accepted by Institution
Note: See TracChangeset for help on using the changeset viewer.