Changeset 13780 for main


Ignore:
Timestamp:
17 Mar 2016, 07:07:58 (9 years ago)
Author:
Henrik Bettermann
Message:

Part-time students are not allowed to pay by instalments.

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

Legend:

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

    r13770 r13780  
    183183
    184184    def test_for_instalment_payments(self):
     185        self.student['studycourse'].certificate.study_mode = 'ug_pt'
    185186        self.student['studycourse'].certificate.school_fee_1 = 6666.0
    186187        self.app['configuration']['2004'].union_fee = 1250.0
     
    188189        self.student.nationality = u'NG'
    189190        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     191        self.browser.open(self.payments_path + '/addop')
     192        self.browser.getControl(name="form.p_category").value = ['schoolfee_1']
     193        self.browser.getControl("Create ticket").click()
     194        self.assertTrue(
     195            'Part-time students are not allowed' in self.browser.contents)
     196        self.student['studycourse'].certificate.study_mode = 'ug_ft'
    190197        self.browser.open(self.payments_path + '/addop')
    191198        self.browser.getControl(name="form.p_category").value = ['schoolfee_1']
  • main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py

    r13755 r13780  
    212212            except (AttributeError, TypeError):
    213213                return _('Study course data are incomplete.'), None
     214            if category in ('schoolfee_1', 'schoolfee_2'):
     215                if student.current_mode == 'ug_pt':
     216                    return _("Part-time students are not allowed "
     217                             "to pay by instalments."), None
     218                if category == 'schoolfee_1' and student.state != CLEARED:
     219                    return _("Wrong state. Only students in state 'cleared' "
     220                             "are allowed to pay by instalments."), None
    214221            if student.state == CLEARED or category == 'schoolfee_2':
    215222                if student.is_foreigner:
     
    221228                    if amount:
    222229                        amount = gateway_net_amt(amount) / 2 + GATEWAY_AMT
    223             elif category == 'schoolfee_1':
    224                 return _("Wrong state. Only students in state 'cleared' "
    225                          "are allowed to pay by instalments."), None
    226230            elif student.state == RETURNING:
    227231                if student.is_postgrad and category == 'schoolfee_incl':
Note: See TracChangeset for help on using the changeset viewer.