Changeset 10681
- Timestamp:
- 1 Nov 2013, 07:59:47 (11 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r10647 r10681 199 199 hostel.hostel_id = u'hall-1' 200 200 hostel.hostel_name = u'Hall 1' 201 hostel.maint_fee = 876.0 201 202 self.app['hostels'].addHostel(hostel) 202 203 bed = Bed() … … 2941 2942 self.assertMatches('...Payment ticket created...', 2942 2943 self.browser.contents) 2944 2945 ctrl = self.browser.getControl(name='val_id') 2946 value = ctrl.options[0] 2947 # Maintennace fee is taken from the hostel object 2948 self.assertEqual(self.student['payments'][value].amount_auth, 876.0) 2949 # If the hostel's maintenance fee isn't set, the fee is 2950 # taken from the session configuration object. 2951 self.app['hostels']['hall-1'].maint_fee = 0.0 2952 self.browser.open(self.payments_path + '/addop') 2953 self.browser.getControl(name="form.p_category").value = ['hostel_maintenance'] 2954 self.browser.getControl("Create ticket").click() 2955 ctrl = self.browser.getControl(name='val_id') 2956 value = ctrl.options[1] 2957 self.assertEqual(self.student['payments'][value].amount_auth, 987.0) 2943 2958 return 2944 2959 -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r10650 r10681 406 406 amount = academic_session.booking_fee 407 407 elif category == 'hostel_maintenance': 408 amount = academic_session.maint_fee408 amount = 0.0 409 409 bedticket = student['accommodation'].get( 410 410 str(student.current_session), None) 411 411 if bedticket: 412 412 p_item = bedticket.bed_coordinates 413 if bedticket.bed.__parent__.maint_fee > 0: 414 amount = bedticket.bed.__parent__.maint_fee 415 else: 416 # fallback 417 amount = academic_session.maint_fee 413 418 else: 414 419 # Should not happen because this is already checked
Note: See TracChangeset for help on using the changeset viewer.