Ignore:
Timestamp:
26 Jun 2023, 21:30:00 (19 months ago)
Author:
Henrik Bettermann
Message:

Implement new school fee calculation based on civ configuration tables.

File:
1 edited

Legend:

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

    r17395 r17457  
    551551        error, payment = utils.setPaymentDetails('schoolfee',
    552552            self.student, 2002, 300, None)
    553         self.assertEqual(payment.amount_auth, 40000.0)
     553        self.assertEqual(payment.amount_auth, 63000.0)
    554554        self.assertEqual(payment.p_session, 2002)
    555555        self.assertEqual(payment.p_level, 300)
     
    557557        error, payment = utils.setPaymentDetails('schoolfee',
    558558            self.student, 2003, 300, None)
    559         self.assertEqual(payment.amount_auth, 20000.0)
     559        self.assertEqual(payment.amount_auth, 26800.0)
    560560        self.assertEqual(payment.p_session, 2003)
    561561        self.assertEqual(payment.p_level, 300)
     
    569569        self.assertEqual(payment.p_level, 100)
    570570        self.assertEqual(payment.p_session, 2004)
    571         self.assertEqual(payment.amount_auth, 40000.0)
     571        self.assertEqual(payment.amount_auth, 63000.0)
    572572        self.assertEqual(payment.p_item, u'CERT1')
    573573        self.assertEqual(error, None)
     
    581581        error, payment = utils.setPaymentDetails('schoolfee',
    582582            self.student, None, None, None)
    583         self.assertEqual(payment.amount_auth, 40099.0)
     583        self.assertEqual(payment.amount_auth, 63099.0)
    584584
    585585        IWorkflowState(self.student).setState('returning')
     
    602602        self.assertEqual(payment.p_level, 200)
    603603        self.assertEqual(payment.p_session, 2005)
    604         self.assertEqual(payment.amount_auth, 20088.0)
     604        self.assertEqual(payment.amount_auth, 26888.0)
    605605        self.assertEqual(payment.p_item, u'CERT1')
    606606        self.assertEqual(error, None)
    607607
    608608        # Old returning students may pay less.
    609         self.certificate.school_fee_2 = 50000.0
    610         self.certificate.custom_float_2 = 30000.0
     609        #self.certificate.school_fee_2 = 50000.0
     610        #self.certificate.custom_float_2 = 30000.0
    611611        error, payment = utils.setPaymentDetails(
    612612            'schoolfee', self.student, None, None, None)
    613         self.assertEqual(payment.amount_auth, 20088.0)
     613        self.assertEqual(payment.amount_auth, 26888.0)
    614614
    615615        # Staff members pay less.
    616         self.certificate.custom_float_2 = None
    617616        self.student.is_staff = True
    618617        error, payment = utils.setPaymentDetails('schoolfee',
     
    620619        self.assertEqual(payment.p_level, 200)
    621620        self.assertEqual(payment.p_session, 2005)
    622         self.assertEqual(payment.amount_auth, 25088.0)
     621        self.assertEqual(payment.amount_auth, 13488.0)
    623622        self.assertEqual(payment.p_item, u'CERT1')
    624623        self.assertEqual(error, None)
     
    628627        self.student.is_staff = False
    629628        self.student.nationality = u'DE'
    630         self.certificate.school_fee_3 = 60000.0
    631629        error, payment = utils.setPaymentDetails(
    632630            'schoolfee', self.student, None, None, None)
    633631        self.assertEqual(payment.p_level, 100)
    634632        self.assertEqual(payment.p_session, 2004)
    635         self.assertEqual(payment.amount_auth, 60099.0)
     633        self.assertEqual(payment.amount_auth, 300099.0)
    636634        self.assertEqual(payment.p_item, u'CERT1')
    637635        self.assertEqual(error, None)
    638636        IWorkflowState(self.student).setState('returning')
    639637        self.student.is_staff = False
    640         self.certificate.school_fee_4 = 20000.0
    641638        error, payment = utils.setPaymentDetails(
    642639            'schoolfee', self.student, None, None, None)
    643640        self.assertEqual(payment.p_level, 200)
    644641        self.assertEqual(payment.p_session, 2005)
    645         self.assertEqual(payment.amount_auth, 20088.0)
     642        self.assertEqual(payment.amount_auth, 277088.0)
    646643        self.assertEqual(payment.p_item, u'CERT1')
    647644        self.assertEqual(error, None)
Note: See TracChangeset for help on using the changeset viewer.