Ignore:
Timestamp:
28 Jun 2020, 20:59:32 (4 years ago)
Author:
Henrik Bettermann
Message:

Fix test.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interswitch/tests.py

    r16082 r16137  
    5353
    5454    def test_interswitch_form(self):
    55         # Manager can access InterswitchForm
     55        self.app['configuration']['2004'].registration_fee = 2000.0
    5656        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    5757        self.browser.open(self.payments_path)
     
    5959        self.student.nationality = u'NG'
    6060        self.browser.open(self.payments_path + '/addop')
    61         self.browser.getControl(name="form.p_category").value = ['schoolfee']
     61        self.browser.getControl(name="form.p_category").value = ['registration']
    6262        self.browser.getControl("Create payment").click()
    63         self.assertMatches('...Payment created...',
    64                            self.browser.contents)
     63        self.assertTrue('Payment created' in self.browser.contents)
    6564        ctrl = self.browser.getControl(name='val_id')
    6665        self.value = ctrl.options[0]
    6766        self.browser.getLink(self.value).click()
    68         self.assertMatches('...Amount Authorized...',
    69                            self.browser.contents)
    70         self.assertTrue(
    71             '<span>40000.0</span>' in self.browser.contents)
     67        self.assertTrue(
     68            '<span>2000.0</span>' in self.browser.contents)
    7269        self.payment_url = self.browser.url
    7370        self.browser.getLink("Pay via Interswitch", index=0).click()
    74         self.assertTrue('<input type="hidden" name="pay_item_id" value="101" />' in
     71        self.assertTrue('<input type="hidden" name="pay_item_id" value="102" />' in
    7572                           self.browser.contents)
    7673        self.assertEqual(self.student.current_mode, 'ug_ft')
    7774        # 250 gateway charge have been added
    7875        payment = self.student['payments'][self.value]
    79         self.assertEqual(payment.amount_auth, 40250)
    80         self.assertEqual(payment.net_amt, 40000)
    81         self.assertTrue(
    82             '<input type="hidden" name="amount" value="4025000" />' in
    83             self.browser.contents)
    84         self.assertTrue(
    85             'item_name="Tuition Plus (total amount)" item_amt="4000000" bank_id="117" acct_num="1011005811"' in
     76        self.assertEqual(payment.amount_auth, 7250)
     77        self.assertEqual(payment.net_amt, 2000)
     78        self.assertTrue(
     79            '<input type="hidden" name="amount" value="725000" />' in
     80            self.browser.contents)
     81        self.assertTrue(
     82            'item_name="Registration Fee" item_amt="200000" bank_id="117" acct_num="1011050158"' in
    8683            self.browser.contents)
    8784
Note: See TracChangeset for help on using the changeset viewer.