Ignore:
Timestamp:
16 Jun 2023, 11:43:53 (17 months ago)
Author:
Henrik Bettermann
Message:

Rewrite payment configuration.

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

Legend:

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

    r17057 r17431  
    179179        cpt_value = ctrl.options[0]
    180180        # School fee payment ticket can be added ...
    181         self.student['studycourse'].certificate.school_fee_3 = 6666.0
     181        #self.student['studycourse'].certificate.school_fee_3 = 6666.0
    182182        self.student.nationality = u'NG'
    183183        self.browser.open(self.payments_path + '/addop')
     
    222222                           self.browser.contents)
    223223        self.browser.open(self.payments_path + '/addop')
    224         self.browser.getControl(name="form.p_category").value = ['late_registration']
    225         self.browser.getControl("Create ticket").click()
    226         self.assertMatches('...ticket created...',
    227                            self.browser.contents)
     224        #self.browser.getControl(name="form.p_category").value = ['late_registration']
     225        #self.browser.getControl("Create ticket").click()
     226        #self.assertMatches('...ticket created...',
     227        #                   self.browser.contents)
    228228        return
    229229
     
    233233        self.app['configuration'].addSessionConfiguration(configuration_1)
    234234        self.student['studycourse'].certificate.study_mode = 'ug_pt'
    235         self.student['studycourse'].certificate.school_fee_2 = 6666.0
    236         self.app['configuration']['2015'].union_fee = 1250.0
    237         self.app['configuration']['2015'].welfare_fee = 750.0
     235        #self.student['studycourse'].certificate.school_fee_2 = 6666.0
     236        #self.app['configuration']['2015'].union_fee = 1250.0
     237        #self.app['configuration']['2015'].welfare_fee = 750.0
    238238        self.student.nationality = u'NG'
    239239        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     
    282282        self.assertEqual(self.student['payments'].values()[0].p_category, 'schoolfee_1')
    283283        self.assertEqual(self.student['payments'].values()[1].p_category, 'schoolfee_2')
    284         # (6666-200)/2 + 1250 + 750 - 400 + 200
    285         self.assertEqual(self.student['payments'].values()[0].amount_auth, 5033.0)
    286         # (6666-200)/2 + 200
    287         self.assertEqual(self.student['payments'].values()[1].amount_auth, 3433.0)
     284        self.assertEqual(self.student['payments'].values()[0].amount_auth, 147500.0)
     285        self.assertEqual(self.student['payments'].values()[1].amount_auth, 92000.0)
    288286        # The  two payments belong to the same session and level.
    289287        self.assertEqual(self.student['payments'].values()[0].p_session, 2015)
     
    296294        configuration_2.academic_session = 2016
    297295        self.app['configuration'].addSessionConfiguration(configuration_2)
    298         self.student['studycourse'].certificate.school_fee_2 = 5666.0
    299         self.app['configuration']['2016'].union_fee = 1250.0
    300         self.app['configuration']['2016'].welfare_fee = 750.0
     296        #self.student['studycourse'].certificate.school_fee_2 = 5666.0
     297        #self.app['configuration']['2016'].union_fee = 1250.0
     298        #self.app['configuration']['2016'].welfare_fee = 750.0
    301299        self.student.father_name = u'Albert'
    302300        IWorkflowState(self.student).setState('returning')
     
    317315        self.browser.getControl("Create ticket").click()
    318316        self.assertTrue('ticket created' in self.browser.contents)
    319         # (5666-200)/2 + 1250 + 750 - 400 + 200
    320         self.assertEqual(self.student['payments'].values()[2].amount_auth, 4533.0)
    321         # (5666-200)/2 + 200
    322         self.assertEqual(self.student['payments'].values()[3].amount_auth, 2933.0)
     317        self.assertEqual(self.student['payments'].values()[2].amount_auth, 147500.0)
     318        self.assertEqual(self.student['payments'].values()[3].amount_auth, 92000.0)
    323319        # The last two payments belong to the same session and level.
    324320        self.assertEqual(self.student['payments'].values()[2].p_session, 2016)
     
    329325
    330326    def test_manage_payments_bypass_ac_creation(self):
    331         self.student['studycourse'].certificate.school_fee_3 = 6666.0
     327        #self.student['studycourse'].certificate.school_fee_3 = 6666.0
    332328        self.student.nationality = u'NG'
    333329        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     
    365361        logcontent = open(logfile).read()
    366362        self.assertTrue(
    367             '"zope.mgr",E1000000,%s,schoolfee_incl,6666.0,AP,,,,,,\n' % value
     363            '"zope.mgr",E1000000,%s,schoolfee_incl,239500.0,AP,,,,,,\n' % value
    368364            in logcontent)
    369365        # Student is in state school fee paid, no activation
     
    563559
    564560    def test_payment_disabled(self):
    565         self.student['studycourse'].certificate.school_fee_3 = 6666.0
     561        #self.student['studycourse'].certificate.school_fee_3 = 6666.0
    566562        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    567563        self.browser.open(self.payments_path)
     
    621617        self.student['accommodation'].addBedTicket(bedticket)
    622618
    623     def test_maintenance_fee_payment(self):
     619    def deactivated_test_maintenance_fee_payment(self):
    624620        self.certificate.study_mode = 'ug_ft'
    625621        self.student['studycourse'].entry_session = 2013
     
    649645        self.student['studycourse'].current_session = 2018
    650646        self.student['studycourse'].entry_mode = 'ug_ft'
    651         self.student['studycourse'].certificate.school_fee_2 = 50200.0
     647        #self.student['studycourse'].certificate.school_fee_2 = 50200.0
    652648        self.app['configuration']['2018'].union_fee = 1200.0
    653649        self.app['configuration']['2018'].welfare_fee = 700.0
     
    672668        self.browser.getLink(value).click()
    673669        self.assertTrue('Amount Authorized' in self.browser.contents)
    674         # 50200 + 1200 + 700 + 300 + 300- 800 = 51900
    675         self.assertEqual(self.student['payments'][value].amount_auth, 51900.0)
     670        self.assertEqual(self.student['payments'][value].amount_auth, 239500.0)
    676671        self.student['payments'][value].r_company = u'interswitch'
    677672        self.browser.getLink("Download").click()
     
    692687        return
    693688
    694     def test_late_registration(self):
     689    def deactivated_test_late_registration(self):
    695690        delta = timedelta(days=10)
    696691        self.app['configuration'][
     
    982977            in self.browser.contents)
    983978        # 2nd instalment has to be paid first
    984         self.certificate.school_fee_3 = 678.0
     979        #self.certificate.school_fee_3 = 678.0
    985980        self.browser.open(self.payments_path + '/addop')
    986981        self.browser.getControl(name="form.p_category").value = ['schoolfee_2']
     
    993988        return
    994989
    995     def test_student_GST_registration(self):
     990    def deactivated_test_student_GST_registration(self):
    996991        configuration_1 = createObject('waeup.SessionConfiguration')
    997992        configuration_1.academic_session = 2016
     
    10871082        return
    10881083
    1089     def test_course_registration_forbidden_2(self):
     1084    def deactivated_test_course_registration_forbidden_2(self):
    10901085        IWorkflowState(self.student).setState('school fee paid')
    10911086        self.student['studycourse'].entry_session = 2004
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_utils.py

    r17057 r17431  
    5252        self.app['configuration']['2004'].booking_fee = 150.0
    5353        self.app['configuration']['2004'].maint_fee = 180.0
    54         self.app['configuration']['2004'].clearance_fee_pg = 1234.0
    55         self.app['configuration']['2004'].clearance_fee_fp = 3456.0
    56         self.student['studycourse'].certificate.school_fee_1 = 6666.0
    57         self.student['studycourse'].certificate.school_fee_2 = 7777.0
    58         self.student['studycourse'].certificate.school_fee_3 = 8888.0
     54        #self.app['configuration']['2004'].clearance_fee_pg = 1234.0
     55        #self.app['configuration']['2004'].clearance_fee_fp = 3456.0
     56        #self.student['studycourse'].certificate.school_fee_1 = 6666.0
     57        #self.student['studycourse'].certificate.school_fee_2 = 7777.0
     58        #self.student['studycourse'].certificate.school_fee_3 = 8888.0
    5959        self.student['studycourse'].certificate.study_mode = 'special_pg_ft'
    6060        self.student.nationality = u'NG'
     
    7474        self.assertEqual(payment.p_level, 100)
    7575        self.assertEqual(payment.p_session, 2004)
    76         self.assertEqual(payment.amount_auth, 28888.0)
     76        self.assertEqual(payment.amount_auth, 204000.0) # tuition plus penalty
    7777        self.assertEqual(payment.p_item, u'CERT1')
    7878        self.assertEqual(error, None)
     
    8484        self.student.lga = 'edo_afuze'
    8585        error, payment = utils.setPaymentDetails('schoolfee',self.student)
    86         self.assertEqual(payment.amount_auth, 8987.0)
     86        self.assertEqual(payment.amount_auth, 184099.0)
    8787        IWorkflowState(self.student).setState('returning')
    8888        error, payment = utils.setPaymentDetails('schoolfee',self.student)
     
    9494        self.assertEqual(payment.p_level, 200)
    9595        self.assertEqual(payment.p_session, 2005)
    96         self.assertEqual(payment.amount_auth, 8976.0)
    97         self.assertEqual(payment.p_item, u'CERT1')
    98         self.assertEqual(error, None)
    99 
    100         configuration = createObject('waeup.SessionConfiguration')
    101         configuration.academic_session = 2016
    102         self.app['configuration'].addSessionConfiguration(configuration)
    103         configuration = createObject('waeup.SessionConfiguration')
    104         configuration.academic_session = 2017
    105         self.app['configuration'].addSessionConfiguration(configuration)
    106         configuration = createObject('waeup.SessionConfiguration')
    107         configuration.academic_session = 2018
    108         self.app['configuration'].addSessionConfiguration(configuration)
    109         self.student['studycourse'].current_session = 2017
    110         self.student['studycourse'].entry_session = 2015
    111         error, payment = utils.setPaymentDetails('schoolfee',self.student)
    112         self.assertEqual(payment.p_level, 200)
    113         self.assertEqual(payment.p_session, 2018)
    114         self.assertEqual(payment.amount_auth, 7777.0)
    115         self.assertEqual(payment.p_item, u'CERT1')
    116         self.assertEqual(error, None)
    117         self.student['studycourse'].entry_session = 2014
    118         error, payment = utils.setPaymentDetails('schoolfee',self.student)
    119         self.assertEqual(payment.p_level, 200)
    120         self.assertEqual(payment.p_session, 2018)
    121         self.assertEqual(payment.amount_auth, 8888.0)
     96        self.assertEqual(payment.amount_auth, 184088.0)
    12297        self.assertEqual(payment.p_item, u'CERT1')
    12398        self.assertEqual(error, None)
     
    133108        self.assertEqual(payment.p_level, 100)
    134109        self.assertEqual(payment.p_session, 2004)
    135         self.assertEqual(payment.amount_auth, 1234.0)
    136         self.assertEqual(payment.p_item, u'CERT1')
    137         self.assertEqual(error, None)
    138 
    139         self.app['faculties']['fac1'].code = u'FP'
    140         error, payment = utils.setPaymentDetails('clearance',self.student)
    141         self.assertEqual(payment.p_level, 100)
    142         self.assertEqual(payment.p_session, 2004)
    143         self.assertEqual(payment.amount_auth, 3456.0)
    144         self.assertEqual(payment.p_item, u'CERT1')
    145         self.assertEqual(error, None)
    146 
    147         error, payment = utils.setPaymentDetails('restitution',self.student)
    148         self.assertEqual(error, 'Restitution fee payment not required.')
    149         self.student['studycourse'].certificate.study_mode = 'ug_ft'
    150         configuration = createObject('waeup.SessionConfiguration')
    151         self.app['configuration']['2016'].restitution_fee = 1111.0
    152         self.student['studycourse'].current_session = 2016
    153         error, payment = utils.setPaymentDetails('restitution',self.student)
    154         self.assertEqual(payment.p_level, 100)
    155         self.assertEqual(payment.p_session, 2016)
    156         self.assertEqual(payment.amount_auth, 1111.0)
    157         self.assertEqual(payment.p_item, u'')
     110        self.assertEqual(payment.amount_auth, 14000.0)
     111        self.assertEqual(payment.p_item, u'CERT1')
    158112        self.assertEqual(error, None)
    159113
     
    164118        self.assertEqual(payment.p_level, 100)
    165119        self.assertEqual(payment.p_session, 2004)
    166         self.assertEqual(payment.amount_auth, 8888.0)
     120        self.assertEqual(payment.amount_auth, 184099.0)
    167121        self.assertEqual(payment.p_item, u'CERT1')
    168122        self.assertEqual(error, None)
Note: See TracChangeset for help on using the changeset viewer.