Changeset 10735 for main/waeup.kwarapoly
- Timestamp:
- 10 Nov 2013, 07:35:27 (11 years ago)
- Location:
- main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/tests/test_browser.py
r10705 r10735 86 86 self.student['accommodation'].addBedTicket(bedticket) 87 87 88 def test_manage_payments(self):89 # Add missing configuration data90 88 self.app['configuration']['2004'].gown_fee = 150.0 91 89 self.app['configuration']['2004'].transfer_fee = 90.0 … … 93 91 self.app['configuration']['2004'].booking_fee = 150.0 94 92 self.app['configuration']['2004'].maint_fee = 180.0 95 93 self.app['configuration']['2004'].certificate_fee = 444.0 94 95 def test_manage_payments(self): 96 96 # Managers can add online payment tickets 97 97 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') … … 177 177 self.browser.getControl("Create ticket").click() 178 178 self.assertMatches('...Amount could not be determined...', 179 self.browser.contents) 180 self.browser.open(self.payments_path + '/addop') 181 self.browser.getControl(name="form.p_category").value = ['certificate'] 182 self.browser.getControl("Create ticket").click() 183 self.assertMatches('...ticket created...', 179 184 self.browser.contents) 180 185 … … 204 209 205 210 def test_set_payment_details(self): 206 self.app['configuration']['2004'].gown_fee = 150.0207 self.app['configuration']['2004'].transfer_fee = 90.0208 self.app['configuration']['2004'].booking_fee = 150.0209 self.app['configuration']['2004'].maint_fee = 180.0210 self.app['configuration']['2004'].clearance_fee = 120.0211 211 utils = getUtility(IStudentsUtils) 212 212 … … 301 301 self.assertEqual(payment.amount_auth, 150.0) 302 302 self.assertEqual(payment.p_item, u'') 303 self.assertEqual(error, None) 304 305 error, payment = utils.setPaymentDetails('certificate',self.student) 306 self.assertEqual(payment.p_level, 100) 307 self.assertEqual(payment.p_session, 2004) 308 self.assertEqual(payment.amount_auth, 444.0) 309 self.assertEqual(payment.p_item, u'') 310 self.assertEqual(payment.p_category, 'certificate') 303 311 self.assertEqual(error, None) 304 312 -
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/utils.py
r10708 r10735 233 233 elif category == 'carryover3': 234 234 amount = 8000.0 235 236 else: 237 fee_name = category + '_fee' 238 amount = getattr(academic_session, fee_name, 0.0) 235 239 if amount in (0.0, None): 236 240 return _(u'Amount could not be determined.'), None
Note: See TracChangeset for help on using the changeset viewer.