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

Rewrite payment configuration.

Location:
main/waeup.aaue/trunk/src/waeup/aaue/interswitch
Files:
1 added
1 edited

Legend:

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

    r17083 r17431  
    7171        self.browser.getControl("Save").click()
    7272
    73     def test_interswitch_form_regular(self):
     73    def deactivated_test_interswitch_form_regular(self):
    7474        self.browser.getControl("Add online").click()
    7575        self.assertTrue('ticket created' in self.browser.contents)
     
    101101            in self.browser.contents)
    102102
    103     def test_interswitch_form_pg(self):
     103    def deactivated_test_interswitch_form_pg(self):
    104104        self.applicant.applicant_id = u'pg_anything'
    105105        self.browser.getControl("Add online").click()
     
    135135            in self.browser.contents)
    136136
    137     def test_interswitch_form_utme(self):
     137    def deactivated_test_interswitch_form_utme(self):
    138138        self.applicant.applicant_id = u'utme_anything'
    139139        self.browser.getControl("Add online").click()
     
    166166            in self.browser.contents)
    167167
    168     def test_interswitch_form_bridge(self):
     168    def deactivated_test_interswitch_form_bridge(self):
    169169        self.applicant.applicant_id = u'bridge_xyz'
    170170        self.browser.getControl("Add online").click()
     
    205205        self.app['configuration']['2004'].interswitch_enabled = True
    206206
    207     def test_interswitch_form_pt_school_fees(self):
     207    def disabled_test_interswitch_form_pt_school_fees(self):
    208208        self.certificate.study_mode = 'ug_pt'
    209209        self.student['studycourse'].entry_session = 2013
     
    232232        self.student['payments']['xyz'] = acc_payment
    233233        self.browser.getLink("Pay via Interswitch", index=0).click()
    234         self.assertTrue('<input type="hidden" name="pay_item_id" value="105" />'
    235                         in self.browser.contents)
    236234        self.assertTrue('Total Amount Authorized:' in self.browser.contents)
    237235        self.assertEqual(self.student.current_mode, 'ug_pt')
     
    246244    def test_interswitch_form_regular_school_fees(self):
    247245        self.certificate.study_mode = 'ug_ft'
    248         self.student['studycourse'].entry_session = 2013
    249         self.student['studycourse'].certificate.school_fee_3 = 51750.0
     246        #self.student['studycourse'].entry_session = 2013
     247        #self.student['studycourse'].certificate.school_fee_3 = 51750.0
    250248        # Manager can access InterswitchForm
    251249        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     
    260258        self.assertTrue('Amount Authorized' in
    261259                           self.browser.contents)
    262         self.assertTrue('<span>51750.0</span>' in self.browser.contents)
    263         self.payment_url = self.browser.url
    264         self.browser.getLink("Pay via Interswitch", index=0).click()
    265         self.assertTrue(
    266             'Please pay acceptance fee first' in self.browser.contents)
    267         acc_payment = createObject('waeup.StudentOnlinePayment')
    268         acc_payment.p_state = 'paid'
    269         acc_payment.p_category = 'clearance'
    270         self.student['payments']['xyz'] = acc_payment
    271         self.browser.getLink("Pay via Interswitch", index=0).click()
    272         self.assertTrue('<input type="hidden" name="pay_item_id" value="107" />'
    273                         in self.browser.contents)
     260        self.assertTrue('<span>239500.0</span>' in self.browser.contents)
     261        self.payment_url = self.browser.url
     262        self.browser.getLink("Pay via Interswitch", index=0).click()
     263        #self.assertTrue(
     264        #    'Please pay acceptance fee first' in self.browser.contents)
     265        #acc_payment = createObject('waeup.StudentOnlinePayment')
     266        #acc_payment.p_state = 'paid'
     267        #acc_payment.p_category = 'clearance'
     268        #self.student['payments']['xyz'] = acc_payment
     269        #self.browser.getLink("Pay via Interswitch", index=0).click()
    274270        self.assertTrue('Total Amount Authorized:'
    275271                        in self.browser.contents)
    276272        self.assertEqual(self.student.current_mode, 'ug_ft')
    277273        self.assertTrue(
    278             '<input type="hidden" name="amount" value="5175000" />'
    279             in self.browser.contents)
    280         self.assertTrue(
    281             'item_name="School Fee Plus" item_amt="4755000" bank_id="117" '
    282             'acct_num="1010827641"' in self.browser.contents)
    283 
    284     def test_interswitch_form_pt_acceptance_fees(self):
     274            '<input type="hidden" name="amount" value="24220000" />'
     275            in self.browser.contents)
     276        self.assertTrue(
     277            'item_name="Faculty Fee (tuition)" item_amt="18400000" bank_id="7" '
     278            'acct_num="1022438743"' in self.browser.contents)
     279
     280        self.student['studycourse'].entry_session = 2015
     281        self.browser.open(self.payments_path + '/addop')
     282        self.browser.getControl(name="form.p_category").value = ['schoolfee_2']
     283        self.browser.getControl("Create ticket").click()
     284        self.assertTrue('ticket created' in
     285                           self.browser.contents)
     286        self.assertTrue('<span>92000.0</span>' in self.browser.contents)
     287        self.payment_url = self.browser.url
     288        self.browser.getLink("Pay via Interswitch", index=0).click()
     289        self.assertTrue(
     290            '<input type="hidden" name="amount" value="9220000" />'
     291            in self.browser.contents)
     292        self.assertTrue(
     293            'item_name="School Fee (2nd instalment)" item_amt="9200000" bank_id="7" acct_num="1022438743"' in self.browser.contents)
     294
     295        self.browser.open(self.payments_path + '/addop')
     296        self.browser.getControl(name="form.p_category").value = ['schoolfee_1']
     297        self.browser.getControl("Create ticket").click()
     298        self.assertTrue('ticket created' in
     299                           self.browser.contents)
     300        self.assertTrue('<span>147500.0</span>' in self.browser.contents)
     301        self.payment_url = self.browser.url
     302        self.browser.getLink("Pay via Interswitch", index=0).click()
     303        self.assertTrue(
     304            '<input type="hidden" name="amount" value="15020000" />'
     305            in self.browser.contents)
     306        self.assertTrue(
     307            'item_name="Faculty Fee (lmsplus)" item_amt="2000000" bank_id="7" acct_num="1022438743"' in self.browser.contents)
     308        self.assertTrue(
     309            'item_name="Faculty Fee (tuition)" item_amt="9200000" bank_id="7" acct_num="1022438743"' in self.browser.contents)
     310
     311        self.browser.open(self.payments_path + '/addop')
     312        self.browser.getControl(name="form.p_category").value = ['schoolfee_2']
     313        self.browser.getControl("Create ticket").click()
     314        self.assertTrue('ticket created' in
     315                           self.browser.contents)
     316        self.assertTrue('<span>92000.0</span>' in self.browser.contents)
     317        self.payment_url = self.browser.url
     318        self.browser.getLink("Pay via Interswitch", index=0).click()
     319        self.assertTrue(
     320            '<input type="hidden" name="amount" value="9220000" />'
     321            in self.browser.contents)
     322        self.assertTrue(
     323            'item_name="School Fee (2nd instalment)" item_amt="9200000" bank_id="7" acct_num="1022438743"' in self.browser.contents)
     324
     325    def disabled_test_interswitch_form_pt_acceptance_fees(self):
    285326        self.certificate.study_mode = 'ug_pt'
    286327        self.app['configuration']['2004'].clearance_fee_ug_pt = 40200.0
     
    301342        self.payment_url = self.browser.url
    302343        self.browser.getLink("Pay via Interswitch", index=0).click()
    303         self.assertTrue('<input type="hidden" name="pay_item_id" value="104" />' in
    304                            self.browser.contents)
    305344        self.assertTrue('Total Amount Authorized:' in self.browser.contents)
    306345        self.assertTrue(
     
    314353    def test_interswitch_form_regular_acceptance_fees(self):
    315354        self.certificate.study_mode = 'ug_ft'
    316         self.app['configuration']['2004'].clearance_fee = 43050.0
     355        #self.app['configuration']['2004'].clearance_fee = 43050.0
    317356        # Manager can access InterswitchForm
    318357        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     
    325364        self.assertTrue('ticket created' in self.browser.contents)
    326365        self.assertTrue('Amount Authorized' in self.browser.contents)
    327         self.assertTrue('<span>43050.0</span>' in self.browser.contents)
    328         self.payment_url = self.browser.url
    329         self.browser.getLink("Pay via Interswitch", index=0).click()
    330         self.assertTrue('<input type="hidden" name="pay_item_id" value="102" />'
    331                         in self.browser.contents)
    332         self.assertTrue('Total Amount Authorized:' in self.browser.contents)
    333         self.assertTrue(
    334             '<input type="hidden" name="amount" value="4305000" />'
    335             in self.browser.contents)
    336         self.assertTrue(
    337             'item_name="Acceptance Fee Plus" item_amt="4135000" bank_id="117" '
    338             'acct_num="1010835352"' in self.browser.contents)
    339 
    340     def test_interswitch_form_concessional_fees(self):
     366        self.assertTrue('<span>16800.0</span>' in self.browser.contents)
     367        self.browser.getLink("Pay via Interswitch", index=0).click()
     368        self.assertTrue('Total Amount Authorized:' in self.browser.contents)
     369        self.assertTrue(
     370            '<input type="hidden" name="amount" value="1850000" />'
     371            in self.browser.contents)
     372        self.assertTrue(self.student['payments'].values()[0].net_amt == 16800)
     373        self.assertTrue(
     374            'item_name="Acceptance Fee (acceptance)" item_amt="1400000" bank_id="8" '
     375            'acct_num="2000249757"' in self.browser.contents)
     376
     377        self.certificate.study_mode = 'bridge'
     378        self.browser.open(self.payments_path + '/addop')
     379        self.browser.getControl(name="form.p_category").value = ['clearance']
     380        self.browser.getControl("Create ticket").click()
     381        self.assertTrue('ticket created' in self.browser.contents)
     382        self.assertTrue('Amount Authorized' in self.browser.contents)
     383        self.assertTrue('<span>14000.0</span>' in self.browser.contents)
     384        self.browser.getLink("Pay via Interswitch", index=0).click()
     385        self.assertTrue('Total Amount Authorized:' in self.browser.contents)
     386        self.assertTrue(
     387            '<input type="hidden" name="amount" value="1570000" />'
     388            in self.browser.contents)
     389        self.assertTrue(self.student['payments'].values()[1].net_amt == 14000)
     390        self.assertTrue(
     391            'item_name="Acceptance Fee" item_amt="1400000" bank_id="8" '
     392            'acct_num="2000249757"' in self.browser.contents)
     393
     394    def deactivated_test_interswitch_form_concessional_fees(self):
    341395        self.certificate.study_mode = 'ug_ft'
    342396        self.app['configuration']['2004'].concessional_fee = 1567.0
     
    356410        self.certificate.study_mode = 'ug_ft'
    357411        self.browser.getLink("Pay via Interswitch", index=0).click()
    358         self.assertTrue('<input type="hidden" name="pay_item_id" value="107" />'
    359                            in self.browser.contents)
    360412        self.assertTrue('Total Amount Authorized:' in self.browser.contents)
    361413        self.assertTrue(
     
    367419            in self.browser.contents)
    368420
    369     def test_interswitch_form_ticket_expired(self):
     421    def deactivated_test_interswitch_form_ticket_expired(self):
    370422        self.certificate.study_mode = 'ug_pt'
    371423        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     
    380432        self.browser.open(self.payments_path + '/xyz')
    381433        self.browser.getLink("Pay via Interswitch", index=0).click()
    382         self.assertTrue('<input type="hidden" name="pay_item_id" value="104" />'
    383                         in self.browser.contents)
    384434        self.assertTrue('Total Amount Authorized:' in self.browser.contents)
    385435        self.assertEqual(self.student.current_mode, 'ug_pt')
Note: See TracChangeset for help on using the changeset viewer.