Changeset 12566 for main/waeup.uniben/trunk/src/waeup/uniben/students
- Timestamp:
- 7 Feb 2015, 10:25:56 (10 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
r12122 r12566 249 249 name="form.p_category").value = ['tempmaint_1'] 250 250 self.browser.getControl("Create ticket").click() 251 self.assertMatches('...You have not yet paid the hostel application fee...', 252 self.browser.contents) 253 self.browser.open(self.payments_path + '/addop') 254 self.browser.getControl(name="form.p_category").value = ['hostel_application'] 255 self.browser.getControl("Create ticket").click() 256 self.assertMatches('...ticket created...', 257 self.browser.contents) 258 ha_ticket = self.student['payments'].values()[2] 259 ha_ticket.approve() 260 self.browser.open(self.payments_path + '/addop') 261 self.browser.getControl( 262 name="form.p_category").value = ['tempmaint_1'] 263 self.browser.getControl("Create ticket").click() 251 264 self.assertMatches('...ticket created...', 252 265 self.browser.contents) … … 579 592 self.assertEqual(error, None) 580 593 581 error, payment = utils.setPaymentDetails('hostel_maintenance', 594 #error, payment = utils.setPaymentDetails('hostel_maintenance', 595 # self.student, None, None) 596 #self.assertEqual(payment.p_level, 100) 597 #self.assertEqual(payment.p_session, 2004) 598 #self.assertEqual(payment.amount_auth, 180.0) 599 #self.assertEqual(payment.p_item, u'') 600 #self.assertEqual(error, None) 601 602 #error, payment = utils.setPaymentDetails('bed_allocation', 603 # self.student, None, None) 604 #self.assertEqual(payment.p_level, 100) 605 #self.assertEqual(payment.p_session, 2004) 606 #self.assertEqual(payment.amount_auth, 150.0) 607 #self.assertEqual(payment.p_item, u'') 608 #self.assertEqual(error, None) 609 610 error, payment = utils.setPaymentDetails('hostel_application', 582 611 self.student, None, None) 583 612 self.assertEqual(payment.p_level, 100) 584 613 self.assertEqual(payment.p_session, 2004) 585 self.assertEqual(payment.amount_auth, 1 80.0)614 self.assertEqual(payment.amount_auth, 1000.0) 586 615 self.assertEqual(payment.p_item, u'') 587 616 self.assertEqual(error, None) 588 617 589 error, payment = utils.setPaymentDetails('bed_allocation', 590 self.student, None, None) 591 self.assertEqual(payment.p_level, 100) 592 self.assertEqual(payment.p_session, 2004) 593 self.assertEqual(payment.amount_auth, 150.0) 594 self.assertEqual(payment.p_item, u'') 595 self.assertEqual(error, None) 618 payment.approve() 619 self.student['payments'][payment.p_id] = payment 596 620 597 621 error, payment = utils.setPaymentDetails('tempmaint_1', -
main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py
r11773 r12566 53 53 if ticket.p_state == 'paid' and \ 54 54 ticket.p_category == 'schoolfee' and \ 55 ticket.p_session == session: 56 return True 57 return False 58 59 def _hostelApplicationPaymentMade(self, student, session): 60 if len(student['payments']): 61 for ticket in student['payments'].values(): 62 if ticket.p_state == 'paid' and \ 63 ticket.p_category == 'hostel_application' and \ 55 64 ticket.p_session == session: 56 65 return True … … 93 102 elif category == 'gown': 94 103 amount = academic_session.gown_fee 95 elif category == 'bed_allocation': 96 amount = academic_session.booking_fee 97 elif category == 'hostel_maintenance': 98 amount = academic_session.maint_fee 99 elif category == 'tempmaint_1': 100 amount = 8150.0 101 elif category == 'tempmaint_2': 102 amount = 12650.0 103 elif category == 'tempmaint_3': 104 amount = 9650.0 104 #elif category == 'bed_allocation': 105 # amount = academic_session.booking_fee 106 #elif category == 'hostel_maintenance': 107 # amount = academic_session.maint_fee 108 elif category == 'hostel_application': 109 amount = 1000.0 110 elif category.startswith('tempmaint'): 111 if not self._hostelApplicationPaymentMade( 112 student, student.current_session): 113 return _( 114 'You have not yet paid the hostel application fee.'), None 115 if category == 'tempmaint_1': 116 amount = 8150.0 117 elif category == 'tempmaint_2': 118 amount = 12650.0 119 elif category == 'tempmaint_3': 120 amount = 9650.0 105 121 elif category == 'clearance': 106 122 p_item = student.certcode … … 196 212 elif category == 'schoolfee': 197 213 amount += academic_session.penalty_ug 198 # XXX: Obsolete in 2013199 214 if category.startswith('tempmaint'): 200 215 p_item = getUtility(IKofaUtils).PAYMENT_CATEGORIES[category] 201 216 p_item = unicode(p_item) 202 217 # Now we change the category because tempmaint payments 203 # will be obsolete in 2013218 # will be obsolete when Uniben returns to Kofa bed allocation. 204 219 category = 'hostel_maintenance' 205 220 # Create ticket.
Note: See TracChangeset for help on using the changeset viewer.