Ignore:
Timestamp:
4 Nov 2015, 15:42:26 (9 years ago)
Author:
Henrik Bettermann
Message:

Re-enable maint payment checking.

Location:
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly
Files:
3 edited

Legend:

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

    r13329 r13389  
    8080        notify(grok.ObjectModifiedEvent(self.student))
    8181
    82     # Maint payment checking disabled on 5th Dec 2014
    83     def xx_test_schoolfee_ticket_creation(self):
     82    def test_schoolfee_ticket_creation(self):
    8483        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    8584        self.browser.open(self.payments_path)
     
    111110        self.assertMatches('...Amount Authorized...',
    112111                           self.browser.contents)
    113         self.assertTrue(
    114             '<span>39400.0</span>' in self.browser.contents)
     112        self.assertTrue('<span>40700.0</span>' in self.browser.contents)
    115113        self.payment_url = self.browser.url
    116114
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/tests/test_browser.py

    r13341 r13389  
    105105        self.browser.open(self.payments_path + '/addop')
    106106
    107         # Maint payment checking disabled on 5th Dec 2014
    108         #self.browser.getControl(name="form.p_category").value = ['schoolfee']
    109         #self.browser.getControl("Create ticket").click()
    110         #self.assertMatches('...Book and pay for accommodation first...',
    111         #                   self.browser.contents)
    112         ## In KwaraPoly only returning students can create school fee payment
    113         ## without having paid accommodation fee
     107        self.browser.getControl(name="form.p_category").value = ['schoolfee']
     108        self.browser.getControl("Create ticket").click()
     109        self.assertMatches('...Book and pay for accommodation first...',
     110                           self.browser.contents)
     111        # In KwaraPoly only returning students can create school fee payment
     112        # without having paid accommodation fee
    114113
    115114        IWorkflowState(self.student).setState('returning')
     
    222221        self.assertEqual(we_ft(self.student), 'ft')
    223222
    224         # Maint payment checking disabled on 5th Dec 2014
    225         #error, payment = utils.setPaymentDetails('schoolfee',self.student)
    226         #self.assertEqual(error,
    227         #    'Book and pay for accommodation first before making'
    228         #    ' school fee payments.')
    229         ## We add a fake maint. payment ticket to meet the condition
    230         #maint_payment = createObject('waeup.StudentOnlinePayment')
    231         #self.student['payments']['any_key'] = maint_payment
    232         #maint_payment.p_category = 'hostel_maintenance'
    233         #maint_payment.p_state = 'paid'
    234         #maint_payment.p_session = 2004
     223        error, payment = utils.setPaymentDetails('schoolfee',self.student)
     224        self.assertEqual(error,
     225            'Book and pay for accommodation first before making'
     226            ' school fee payments.')
     227        # We add a fake maint. payment ticket to meet the condition
     228        maint_payment = createObject('waeup.StudentOnlinePayment')
     229        self.student['payments']['any_key'] = maint_payment
     230        maint_payment.p_category = 'hostel_maintenance'
     231        maint_payment.p_state = 'paid'
     232        maint_payment.p_session = 2004
    235233
    236234        error, payment = utils.setPaymentDetails('schoolfee',self.student)
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/utils.py

    r13306 r13389  
    132132
    133133    def _maintPaymentMade(self, student, session):
    134 
    135         # Maint payment checking disabled on 5th Dec 2014
    136         return True
    137 
    138         #if len(student['payments']):
    139         #    for ticket in student['payments'].values():
    140         #        if ticket.p_category == 'hostel_maintenance' and \
    141         #            ticket.p_session == session and ticket.p_state == 'paid':
    142         #                return True
    143         #return False
     134        if len(student['payments']):
     135            for ticket in student['payments'].values():
     136                if ticket.p_category == 'hostel_maintenance' and \
     137                    ticket.p_session == session and ticket.p_state == 'paid':
     138                        return True
     139        return False
    144140
    145141    def _bedAvailable(self, student):
Note: See TracChangeset for help on using the changeset viewer.