Ignore:
Timestamp:
16 Jul 2012, 07:36:13 (12 years ago)
Author:
Henrik Bettermann
Message:

Add special school fee regulations for staff members and foreign students.

File:
1 edited

Legend:

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

    r8959 r9006  
    8686                           self.browser.contents)
    8787        IWorkflowState(self.student).setState('cleared')
     88        self.student.nationality = u'NG'
    8889        self.browser.open(self.payments_path + '/addop')
    8990        self.browser.getControl("Create ticket").click()
     
    190191        return
    191192
     193    def test_set_returning_data(self):
     194        # Student is in level 100, session 2004 with verdict A
     195        utils = getUtility(IStudentsUtils)
     196
     197        utils.setReturningData(self.student)
     198        self.assertEqual(self.student['studycourse'].current_session, 2005)
     199        self.assertEqual(self.student['studycourse'].current_level, 200)
     200
     201        self.student['studycourse'].current_session = 2004
     202        self.student['studycourse'].current_level = 100
     203        self.student['studycourse'].current_verdict = 'C'
     204        utils.setReturningData(self.student)
     205        self.assertEqual(self.student['studycourse'].current_session, 2005)
     206        self.assertEqual(self.student['studycourse'].current_level, 110)
     207
     208        self.student['studycourse'].current_session = 2004
     209        self.student['studycourse'].current_level = 100
     210        self.student['studycourse'].current_verdict = 'D'
     211        utils.setReturningData(self.student)
     212        self.assertEqual(self.student['studycourse'].current_session, 2005)
     213        self.assertEqual(self.student['studycourse'].current_level, 100)
     214        return
     215
    192216    def test_set_payment_details(self):
    193217        self.app['configuration']['2004'].gown_fee = 150.0
     
    206230
    207231        IWorkflowState(self.student).setState('cleared')
     232        self.student.nationality = u'NG'
    208233        error, payment = utils.setPaymentDetails('schoolfee',self.student)
    209234        self.assertEqual(payment.p_level, 100)
     
    229254        self.assertEqual(error, None)
    230255
     256        self.student.is_staff = True
     257        error, payment = utils.setPaymentDetails('schoolfee',self.student)
     258        self.assertEqual(payment.p_level, 200)
     259        self.assertEqual(payment.p_session, 2005)
     260        self.assertEqual(payment.amount_auth, 10088.0)
     261        self.assertEqual(payment.p_item, u'CERT1')
     262        self.assertEqual(error, None)
     263
     264        IWorkflowState(self.student).setState('cleared')
     265        self.student.is_staff = False
     266        self.student.nationality = u'DE'
     267        self.certificate.school_fee_3 = 60000.0
     268        error, payment = utils.setPaymentDetails('schoolfee',self.student)
     269        self.assertEqual(payment.p_level, 100)
     270        self.assertEqual(payment.p_session, 2004)
     271        self.assertEqual(payment.amount_auth, 60099.0)
     272        self.assertEqual(payment.p_item, u'CERT1')
     273        self.assertEqual(error, None)
     274
     275        IWorkflowState(self.student).setState('returning')
     276        self.student.is_staff = False
     277        self.student.nationality = u'DE'
     278        self.certificate.school_fee_4 = 20000.0
     279        error, payment = utils.setPaymentDetails('schoolfee',self.student)
     280        self.assertEqual(payment.p_level, 200)
     281        self.assertEqual(payment.p_session, 2005)
     282        self.assertEqual(payment.amount_auth, 20088.0)
     283        self.assertEqual(payment.p_item, u'CERT1')
     284        self.assertEqual(error, None)
     285
    231286        error, payment = utils.setPaymentDetails('clearance',self.student)
    232287        self.assertEqual(payment.p_level, 100)
Note: See TracChangeset for help on using the changeset viewer.