Changeset 9431 for main/waeup.futminna/trunk/src
- Timestamp:
- 26 Oct 2012, 20:59:03 (12 years ago)
- Location:
- main/waeup.futminna/trunk/src/waeup/futminna
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.futminna/trunk/src/waeup/futminna/interswitch/tests.py
r9410 r9431 116 116 self.browser.getControl(name="form.p_category").value = ['hostel_maintenance'] 117 117 self.browser.getControl("Create ticket").click() 118 self.assertMatches('...You have not yet booked accommodation...', 119 self.browser.contents) 120 # Students have to book bed first 121 self.browser.open(self.acco_path) 122 IWorkflowState(self.student).setState('admitted') 123 self.browser.getLink("Book accommodation").click() 124 self.assertFalse('Activation Code:' in self.browser.contents) 125 self.browser.getControl("Create bed ticket").click() 126 # Bed is randomly selected but, since there is only 127 # one bed for this student, we know that ... 128 self.assertMatches('...Hall 1, Block A, Room 101, Bed A...', 129 self.browser.contents) 130 self.browser.open(self.payments_path + '/addop') 131 self.browser.getControl(name="form.p_category").value = ['hostel_maintenance'] 132 self.browser.getControl("Create ticket").click() 118 133 self.assertMatches('...ticket created...', 119 134 self.browser.contents) -
main/waeup.futminna/trunk/src/waeup/futminna/students/tests/test_browser.py
r9409 r9431 28 28 from waeup.kofa.university.department import Department 29 29 from waeup.kofa.students.tests.test_browser import StudentsFullSetup 30 from waeup.kofa.students.accommodation import BedTicket 30 31 from waeup.kofa.testing import FunctionalTestCase 31 32 from waeup.kofa.interfaces import ( … … 87 88 self.app['faculties']['SSE']['dep1'].certificates.addCertificate( 88 89 self.certificate2) 90 # Create EET faculty with certificate 91 self.app['faculties']['EET'] = Faculty(code='EET') 92 self.app['faculties']['EET']['dep1'] = Department(code='dep1') 93 self.certificate3 = createObject('waeup.Certificate') 94 self.certificate3.code = u'CERT3' 95 self.certificate3.application_category = 'basic' 96 self.certificate3.study_mode = 'ug_ft' 97 self.certificate3.start_level = 100 98 self.certificate3.end_level = 300 99 self.app['faculties']['EET']['dep1'].certificates.addCertificate( 100 self.certificate3) 89 101 # Set study course attributes of test student 90 102 self.student['studycourse'].certificate = self.certificate2 … … 160 172 161 173 error, payment = utils.setPaymentDetails('hostel_maintenance',self.student) 174 self.assertEqual(error, 'You have not yet booked accommodation.') 175 bedticket = BedTicket() 176 bedticket.booking_session = 2004 177 bedticket.bed_type = u'any bed type' 178 bedticket.bed = self.app['hostels']['hall-1']['hall-1_A_101_A'] 179 bedticket.bed_coordinates = u'My bed coordinates' 180 self.student['accommodation'].addBedTicket(bedticket) 181 error, payment = utils.setPaymentDetails('hostel_maintenance',self.student) 162 182 self.assertEqual(payment.p_level, 100) 163 183 self.assertEqual(payment.p_session, 2004) 164 184 self.assertEqual(payment.amount_auth, 10000.0) 165 self.assertEqual(payment.p_item, u'sse_male_fr') 166 self.assertEqual(error, None) 167 168 self.student['studycourse'].certificate = self.certificate 169 error, payment = utils.setPaymentDetails('hostel_maintenance',self.student) 170 self.assertEqual(payment.p_level, 100) 171 self.assertEqual(payment.p_session, 2004) 172 self.assertEqual(payment.amount_auth, 10000.0) 173 self.assertEqual(payment.p_item, u'regular_male_fr') 174 self.assertEqual(error, None) 175 176 error, payment = utils.setPaymentDetails('block_h_maintenance',self.student) 185 self.assertEqual(payment.p_item, u'My bed coordinates') 186 self.assertEqual(error, None) 187 188 self.student['studycourse'].certificate = self.certificate3 189 error, payment = utils.setPaymentDetails('hostel_maintenance',self.student) 190 self.assertEqual(payment.p_level, 100) 191 self.assertEqual(payment.p_session, 2004) 192 self.assertEqual(payment.amount_auth, 12000.0) 193 self.assertEqual(payment.p_item, u'My bed coordinates') 194 self.assertEqual(error, None) 195 196 bedticket.bed.bed_id = u'block-h_anything' 197 error, payment = utils.setPaymentDetails('hostel_maintenance',self.student) 177 198 self.assertEqual(payment.p_level, 100) 178 199 self.assertEqual(payment.p_session, 2004) 179 200 self.assertEqual(payment.amount_auth, 15000.0) 180 self.assertEqual(payment.p_item, u' regular_male_fr')201 self.assertEqual(payment.p_item, u'My bed coordinates') 181 202 self.assertEqual(error, None) 182 203 -
main/waeup.futminna/trunk/src/waeup/futminna/students/utils.py
r9409 r9431 116 116 amount = 20000.0 117 117 elif category == 'hostel_maintenance': 118 current_session = student['studycourse'].current_session 119 bedticket = student['accommodation'].get(str(current_session), None) 120 if bedticket: 121 p_item = bedticket.bed_coordinates 122 else: 123 return _(u'You have not yet booked accommodation.'), None 118 124 acc_details = self.getAccommodationDetails(student) 119 if student['studycourse'].current_session != acc_details[ 120 'booking_session']: 125 if current_session != acc_details['booking_session']: 121 126 return _(u'Current session does not match accommodation session.'), None 122 if student.current_level in ('100','200','300','400','500') and \ 127 if bedticket.bed.bed_id.startswith('block-h'): 128 amount = 15000.0 129 elif student.current_level in (100,200,300,400,500) and \ 123 130 student.faccode in ('EET','SET','AAT','ICT','EMT'): 124 131 amount = 12000.0 125 132 else: 126 133 amount = 10000.0 127 p_item = acc_details['bt']128 elif category == 'block_h_maintenance':129 acc_details = self.getAccommodationDetails(student)130 if student['studycourse'].current_session != acc_details[131 'booking_session']:132 return _(u'Current session does not match accommodation session.'), None133 amount = 15000.0134 p_item = acc_details['bt']135 134 elif category == 'bed_allocation': 136 135 p_item = self.getAccommodationDetails(student)['bt'] -
main/waeup.futminna/trunk/src/waeup/futminna/utils/utils.py
r9419 r9431 36 36 'schoolfee': 'School Fee', 37 37 'clearance': 'Acceptance Fee', 38 #'hostel_maintenance': 'Regular Hostel Maintenance Fee', 39 #'block_h_maintenance': 'Block H Maintenance Fee', 38 'hostel_maintenance': 'Hostel Maintenance Fee', 40 39 'application': 'Application Fee' 41 40 }
Note: See TracChangeset for help on using the changeset viewer.