Ignore:
Timestamp:
7 May 2014, 18:21:58 (11 years ago)
Author:
Henrik Bettermann
Message:

To guarantee that cleared students pay both acceptance fee and school fees,
the eTranzact History can only be queried for school fee payments if
acceptance/clearance fee has been successfully queried/paid beforehand.

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

Legend:

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

    r11624 r11627  
    135135                           self.browser.contents)
    136136        self.app['configuration']['2004'].school_fee_1 = 6666.0
    137         self.browser.getControl(name="form.p_category").value = ['schoolfee']
     137        #self.browser.getControl(name="form.p_category").value = ['schoolfee']
    138138        # Accepotance fee must be paid first
    139         self.browser.getControl("Create ticket").click()
    140         self.assertMatches('...Please pay acceptance fee first...',
    141                            self.browser.contents)
     139        #self.browser.getControl("Create ticket").click()
     140        #self.assertMatches('...Please pay acceptance fee first...',
     141        #                   self.browser.contents)
    142142        self.app['configuration']['2004'].clearance_fee = 666.0
    143143        self.browser.getControl(name="form.p_category").value = ['clearance']
    144144        self.browser.getControl("Create ticket").click()
    145145        ctrl = self.browser.getControl(name='val_id')
    146         value = ctrl.options[0]
    147         self.student['payments'][value].approveStudentPayment()
     146        cpt_value = ctrl.options[0]
     147        # School fee payment ticket can be added ...
    148148        self.browser.open(self.payments_path + '/addop')
    149149        self.browser.getControl(name="form.p_category").value = ['schoolfee']
     
    151151        self.assertMatches('...ticket created...',
    152152                           self.browser.contents)
     153        # ... but not paid through the query_history page.
    153154        ctrl = self.browser.getControl(name='val_id')
    154         value = ctrl.options[1]
    155         self.browser.getLink(value).click()
    156         self.assertMatches('...Amount Authorized...',
    157                            self.browser.contents)
     155        sfpt_value = ctrl.options[1]
     156        self.browser.open(self.payments_path + '/' + sfpt_value)
     157        self.browser.getLink("Query eTranzact History").click()
     158        self.assertMatches('...alert-danger">Please pay acceptance fee first...',
     159                           self.browser.contents)
     160        # If clearance/acceptance fee is paid ...
     161        self.student['payments'][cpt_value].approveStudentPayment()
     162        self.browser.getLink("Query eTranzact History").click()
     163        # ... query_history page is accessible.
     164        self.assertMatches(
     165            '...<h1 class="kofa-content-label">Requery eTranzact History</h1>...',
     166            self.browser.contents)
    158167        # Managers can open school fee payment slip
     168        self.browser.open(self.payments_path + '/' + sfpt_value)
    159169        self.browser.getLink("Download payment slip").click()
    160170        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    161171        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
    162         # Set ticket paid
    163         ticket = self.student['payments'][value].approveStudentPayment()
     172        # If school fee ticket is paid ...
     173        ticket = self.student['payments'][sfpt_value].approveStudentPayment()
     174        # ... no further school fee ticket can be added.
    164175        self.browser.open(self.payments_path + '/addop')
    165176        self.browser.getControl(name="form.p_category").value = ['schoolfee']
     
    167178        self.assertMatches('...This type of payment has already been made...',
    168179                           self.browser.contents)
    169 
    170180
    171181    def deactivated_test_for_instalment_payments(self):
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_utils.py

    r11624 r11627  
    3737        return
    3838
     39    def test_no_clearance_ac_code_created(self):
     40        payment = createObject('waeup.StudentOnlinePayment')
     41        payment.p_category = 'clearance'
     42        self.student['payments']['any_id'] = payment
     43        payment.approveStudentPayment()
     44        # No activation code created.
     45        self.assertEqual(payment.ac, None)
     46
    3947    def test_set_payment_details(self):
    4048        self.app['configuration']['2004'].gown_fee = 150.0
     
    5462        self.assertEqual(payment, None)
    5563        self.assertEqual(error, u'Wrong state.')
    56 
    5764        IWorkflowState(self.student).setState('cleared')
    58         error, payment = utils.setPaymentDetails('schoolfee',self.student)
    59         # Acceptance fee must be paid first.
    60         self.assertEqual(error, 'Please pay acceptance fee first.')
    61         payment = createObject('waeup.StudentOnlinePayment')
    62         payment.p_category = 'clearance'
    63         self.student['payments']['any_id'] = payment
    64         payment.approveStudentPayment()
    65         # No activation code created.
    66         self.assertEqual(payment.ac, None)
    6765        # School fee can be set.
    6866        error, payment = utils.setPaymentDetails('schoolfee',self.student)
     
    7270        self.assertEqual(payment.p_item, u'CERT1')
    7371        self.assertEqual(error, None)
    74 
    7572        # Add penalty fee ...
    7673        # ... for cleared
Note: See TracChangeset for help on using the changeset viewer.