Ignore:
Timestamp:
12 Jan 2013, 08:51:37 (12 years ago)
Author:
Henrik Bettermann
Message:

Balance must not be negative or zero.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py

    r9868 r9874  
    791791    balance_amount = schema.Float(
    792792        title = _(u'Balance Amount'),
    793         default = 0.0,
     793        default = None,
    794794        required = True,
    795795        readonly = False,
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r9868 r9874  
    23992399        self.browser.getControl(name="form.balance_session").value = ['2004']
    24002400        self.browser.getControl(name="form.balance_level").value = ['300']
     2401        self.browser.getControl(name="form.balance_amount").value = '-567.8'
     2402        self.browser.getControl("Create ticket").click()
     2403        self.assertMatches('...Amount must be greater than 0...',
     2404                           self.browser.contents)
     2405        self.browser.getControl(name="form.balance_amount").value = '0'
     2406        self.browser.getControl("Create ticket").click()
     2407        self.assertMatches('...Amount must be greater than 0...',
     2408                           self.browser.contents)
    24012409        self.browser.getControl(name="form.balance_amount").value = '567.8'
    24022410        self.browser.getControl("Create ticket").click()
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r9868 r9874  
    434434        if academic_session == None:
    435435            return _(u'Session configuration object is not available.'), None
    436         if amount in (0.0, None):
    437             return _('Amount could not be determined.'), None
     436        if amount in (0.0, None) or amount < 0:
     437            return _('Amount must be greater than 0.'), None
    438438        for key in student['payments'].keys():
    439439            ticket = student['payments'][key]
Note: See TracChangeset for help on using the changeset viewer.