Ignore:
Timestamp:
30 Oct 2013, 19:43:48 (11 years ago)
Author:
Henrik Bettermann
Message:

New students must book and pay for accommodation first, before making school fee payments.

File:
1 edited

Legend:

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

    r10672 r10675  
    104104        self.browser.getControl(name="form.p_category").value = ['schoolfee']
    105105        self.browser.getControl("Create ticket").click()
     106
     107        self.assertMatches('...Book and pay for accommodation first...',
     108                           self.browser.contents)
     109
     110        # In KwaraPoly only returning students can create school fee payment
     111        # without haveing paid accommodation fee
     112        IWorkflowState(self.student).setState('returning')
     113        configuration = createObject('waeup.SessionConfiguration')
     114        configuration.academic_session = 2005
     115        self.app['configuration'].addSessionConfiguration(configuration)
     116        self.browser.getControl(name="form.p_category").value = ['schoolfee']
     117        self.browser.getControl("Create ticket").click()
    106118        self.assertMatches('...ticket created...',
    107119                           self.browser.contents)
     
    155167        self.browser.open(self.payments_path + '/addop')
    156168        self.browser.getControl(name="form.p_category").value = ['schoolfee']
    157         self.browser.getControl("Create ticket").click()
    158         self.assertMatches('...ticket created...',
    159                            self.browser.contents)
    160         # In state returning we can add a new school fee ticket since
    161         # p_session and p_level is different
    162         IWorkflowState(self.student).setState('returning')
    163         self.browser.open(self.payments_path + '/addop')
    164         self.browser.getControl(name="form.p_category").value = ['schoolfee']
    165         self.browser.getControl("Create ticket").click()
    166         # Uups, we forgot to add a session configuration for next session
    167         self.assertTrue('Session configuration object is not available.'
    168             in self.browser.contents)
    169         configuration = createObject('waeup.SessionConfiguration')
    170         configuration.academic_session = 2005
    171         self.app['configuration'].addSessionConfiguration(configuration)
    172169        self.browser.getControl("Create ticket").click()
    173170        self.assertMatches('...ticket created...',
     
    222219        self.assertEqual(pt_ft(self.student), 'ft')
    223220
     221        error, payment = utils.setPaymentDetails('schoolfee',self.student)
     222        self.assertEqual(error,
     223            'Book and pay for accommodation first before making'
     224            ' school fee payments.')
     225        # We add a fake maint. payment ticket to meet the condition
     226        maint_payment = createObject('waeup.StudentOnlinePayment')
     227        self.student['payments']['any_key'] = maint_payment
     228        maint_payment.p_category = 'hostel_maintenance'
     229        maint_payment.p_state = 'paid'
     230        maint_payment.p_session = 2004
    224231        error, payment = utils.setPaymentDetails('schoolfee',self.student)
    225232        self.assertEqual(payment.p_level, 100)
Note: See TracChangeset for help on using the changeset viewer.