Ignore:
Timestamp:
5 Apr 2016, 05:48:39 (9 years ago)
Author:
Henrik Bettermann
Message:

Catch pg balance payments.

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

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/etranzact/browser.py

    r13784 r13799  
    158158            self.output = ERROR_PART1 + 'Not a postgrad student' + ERROR_PART2
    159159            return
    160         if student and '-PG' not in PAYMENT_TYPE and student.is_postgrad:
     160        if student and '-PG' not in PAYMENT_TYPE and student.is_postgrad \
     161            and results[0].p_item != 'Balance':
    161162            self.output = ERROR_PART1 + 'Postgrad student' + ERROR_PART2
    162163            return
  • main/waeup.aaue/trunk/src/waeup/aaue/etranzact/tests.py

    r13784 r13799  
    144144        self.assertEqual(self.browser.contents, ERROR_PART1 + 'Wrong PAYMENT_TYPE' + ERROR_PART2)
    145145
     146        # Change payment state
    146147        self.student['payments'][self.p_id].p_state = 'paid'
     148
    147149        self.browser.open(
    148150            'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=SCHOOL-FEE-NEW'
     
    150152        self.assertEqual(self.browser.contents, ERROR_PART1 + 'PAYEE_ID already used' + ERROR_PART2)
    151153
     154        # Change workflow state and payment state
    152155        IWorkflowState(self.student).setState('returning')
    153156        self.student['payments'][self.p_id].p_state = 'unpaid'
     157
    154158        self.browser.open(
    155159            'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=SCHOOL-FEE-NEW'
     
    161165            % self.p_id)
    162166        self.assertEqual(self.browser.contents, ERROR_PART1 + 'Not a balance payment' + ERROR_PART2)
     167
     168        # Change payment item
    163169        self.payment.p_item = u'Balance'
     170
    164171        self.browser.open(
    165172            'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=SCHOOL-FEE-PLUS-RETURNING'
    166173            % self.p_id)
    167174        self.assertEqual(self.browser.contents, ERROR_PART1 + 'Balance payment' + ERROR_PART2)
     175
     176        # Change study mode
     177        self.certificate.study_mode = 'special_pg_ft'
     178
     179        self.browser.open(
     180            'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=SCHOOL-FEE-BALANCE'
     181            % self.p_id)
     182        self.assertEqual(self.browser.contents,
     183            'PayeeName=Anna Tester~'
     184            'Faculty=fac1~'
     185            'Department=dep1~'
     186            'Level=100~'
     187            'ProgrammeType=Balance~'
     188            'StudyType=special_pg_ft~'
     189            'Session=2004/2005~'
     190            'PayeeID=%s~'
     191            'Amount=1234.0~'
     192            'FeeStatus=unpaid~'
     193            'Semester=N/A~'
     194            'PaymentType=School Fee Plus~'
     195            'MatricNumber=E1000000~'
     196            'Email=aa@aa.ng~'
     197            'PhoneNumber=1234' % self.p_id)
     198
     199        # Change payment item
    168200        self.payment.p_item = u'CERT1'
    169201
     202        self.browser.open(
     203            'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=SCHOOL-FEE-PLUS-RETURNING'
     204            % self.p_id)
     205        self.assertEqual(self.browser.contents, ERROR_PART1 + 'Postgrad student' + ERROR_PART2)
     206
     207        # Cange payment category and study mode
    170208        self.payment.p_category = 'schoolfee'
    171         self.certificate.study_mode = 'special_pg_ft'
    172         self.browser.open(
    173             'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=SCHOOL-FEE-RETURNING'
    174             % self.p_id)
    175         self.assertEqual(self.browser.contents, ERROR_PART1 + 'Postgrad student' + ERROR_PART2)
    176 
    177209        self.certificate.study_mode = 'ug_ft'
     210       
    178211        self.browser.open(
    179212            'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=SCHOOL-FEE-RETURNING'
Note: See TracChangeset for help on using the changeset viewer.