Changeset 14556


Ignore:
Timestamp:
17 Feb 2017, 16:27:53 (8 years ago)
Author:
Henrik Bettermann
Message:

NCE repeaters don't have to pay penalty fee.

Location:
main/waeup.fceokene/trunk/src/waeup/fceokene/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/tests/test_utils.py

    r13614 r14556  
    22import grok
    33from waeup.kofa.testing import FunctionalTestCase
    4 from zope.component import getUtility
     4from hurry.workflow.interfaces import IWorkflowState
     5from zope.component import getUtility, createObject
    56from waeup.kofa.students.interfaces import IStudentsUtils
    67from waeup.kofa.students.tests.test_browser import StudentsFullSetup
     
    4142        max_credits = students_utils.maxCreditsExceeded(studylevel, course)
    4243        self.assertEqual(max_credits, 58)
     44        return
     45
     46    def test_set_payment_details(self):
     47        self.certificate.end_level = 300
     48        self.student['studycourse'].current_verdict = 'B'
     49        self.student['studycourse'].current_level = 300
     50        configuration = createObject('waeup.SessionConfiguration')
     51        configuration.academic_session = 2005
     52        self.app['configuration'].addSessionConfiguration(configuration)
     53        self.app['configuration']['2005'].penalty_nce_ft = 99.0
     54        self.student['studycourse'].certificate.study_mode = 'nce_ft'
     55        utils = getUtility(IStudentsUtils)
     56        error, payment = utils.setPaymentDetails('schoolfee',self.student)
     57        IWorkflowState(self.student).setState('returning')
     58        error, payment = utils.setPaymentDetails('schoolfee',self.student)
     59        self.assertEqual(payment.amount_auth, 12224.0) # 11975 + 150 + 99
     60        self.student['studycourse'].previous_verdict = 'O'
     61        error, payment = utils.setPaymentDetails('schoolfee',self.student)
     62        self.assertEqual(payment.amount_auth, 12125.0) # 11975 + 150
     63        return
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/utils.py

    r14379 r14556  
    282282            amount += academic_session.penalty_ug_ft
    283283        elif category == 'schoolfee' and student.current_mode in (
    284             'nce_ft',):
     284            'nce_ft',) and student['studycourse'].previous_verdict != 'O':
    285285            amount += academic_session.penalty_nce_ft
    286286        elif category == 'schoolfee' and student.current_mode in (
Note: See TracChangeset for help on using the changeset viewer.