Ignore:
Timestamp:
22 Oct 2011, 08:43:54 (13 years ago)
Author:
Henrik Bettermann
Message:

Test coverage now 100%

Location:
main/waeup.custom/trunk/src/waeup/custom
Files:
1 added
2 edited

Legend:

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

    r6925 r6926  
    1010    def test_manage_payments(self):
    1111
     12        # Managers can add online payment tickets
     13        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     14        self.browser.open(self.payments_student_path)
     15        self.browser.getLink("Manage").click()
     16        self.browser.getControl("Add online payment ticket").click()
     17        self.browser.getControl("Create ticket").click()
     18        self.assertMatches('...Session configuration object is not available...',
     19                           self.browser.contents)
     20
    1221        # Set up SessionConfiguration object
    1322        configuration = SessionConfiguration()
     
    1625        self.app['configuration'].addSessionConfiguration(configuration)
    1726
    18         # Managers can add online payment tickets
    19         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    2027        self.browser.open(self.payments_student_path)
    2128        self.browser.getLink("Manage").click()
     
    4653        self.assertMatches('...ticket created...',
    4754                           self.browser.contents)
     55        self.browser.open(self.payments_student_path + '/addop')
     56        self.browser.getControl(name="form.p_category").value = ['gown']
     57        self.browser.getControl("Create ticket").click()
     58        self.browser.open(self.payments_student_path + '/addop')
     59        self.browser.getControl(name="form.p_category").value = ['transfer']
     60        self.browser.getControl("Create ticket").click()
     61        self.browser.open(self.payments_student_path + '/addop')
     62        self.browser.getControl(name="form.p_category").value = ['hostel_maintenance']
     63        self.browser.getControl("Create ticket").click()
     64        self.certificate.study_mode = 'ug_pt'
     65        self.browser.open(self.payments_student_path + '/addop')
     66        self.browser.getControl(name="form.p_category").value = ['schoolfee']
     67        self.browser.getControl("Create ticket").click()
     68        self.assertMatches('...Amount could not be determined...',
     69                           self.browser.contents)
     70
     71
  • main/waeup.custom/trunk/src/waeup/custom/students/utils.py

    r6925 r6926  
    2626        surcharge_1 = academic_session.surcharge_1
    2727        surcharge_2 = academic_session.surcharge_2
    28         try:
    29             amount = getSchoolFee(student, surcharge_1 + surcharge_2)
    30             code = student['studycourse'].certificate.code
    31         except AttributeError:
    32             return 0, None, None, 0, 0, 0, 'School Fee could not be determined.'
     28        amount = getSchoolFee(student, surcharge_1 + surcharge_2)
     29        code = student['studycourse'].certificate.code
    3330        #session_string = academic_sessions_vocab.by_value[p_session + 1].title
    3431        p_item = code
Note: See TracChangeset for help on using the changeset viewer.