- Timestamp:
- 9 Jul 2012, 14:41:08 (12 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue
- Property svn:mergeinfo changed
/main/waeup.uniben/trunk/src/waeup/uniben merged: 8959
- Property svn:mergeinfo changed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py
r8909 r8961 177 177 self.browser.getControl(name="form.p_category").value = ['schoolfee_1'] 178 178 self.browser.getControl("Create ticket").click() 179 self.assertMatches('...ticket created...', 180 self.browser.contents) 181 179 self.assertMatches('...Session configuration object is not...', 180 self.browser.contents) 181 # Uups, we forgot to add a session configuration for next session 182 configuration = createObject('waeup.SessionConfiguration') 183 configuration.academic_session = 2005 184 self.app['configuration'].addSessionConfiguration(configuration) 185 self.app['configuration']['2005'].school_fee_base = 7777.0 186 self.browser.open(self.payments_path + '/addop') 187 self.browser.getControl(name="form.p_category").value = ['schoolfee_1'] 188 self.browser.getControl("Create ticket").click() 189 self.assertMatches('...ticket created...', 190 self.browser.contents) 182 191 # If the session configuration doesn't exist an error message will 183 192 # be shown. No other requirement is being checked. … … 208 217 utils = getUtility(IStudentsUtils) 209 218 219 configuration = createObject('waeup.SessionConfiguration') 220 configuration.academic_session = 2005 221 self.app['configuration'].addSessionConfiguration(configuration) 222 self.app['configuration']['2005'].school_fee_base = 7777.0 223 210 224 error, payment = utils.setPaymentDetails('schoolfee_1',self.student) 211 225 self.assertEqual(payment, None) … … 220 234 self.assertEqual(error, None) 221 235 222 # Add penalty fee. 236 # Add penalty fee ... 237 # ... for cleared 223 238 self.app['configuration']['2004'].penalty_ug = 99.0 239 # ... for returning 240 self.app['configuration']['2005'].penalty_ug = 88.0 224 241 error, payment = utils.setPaymentDetails('schoolfee_1',self.student) 225 242 self.assertEqual(payment.amount_auth, 6765.0) 226 227 243 IWorkflowState(self.student).setState('returning') 228 244 error, payment = utils.setPaymentDetails('schoolfee_1',self.student) 229 245 self.assertEqual(payment.p_level, 200) 230 246 self.assertEqual(payment.p_session, 2005) 231 self.assertEqual(payment.amount_auth, 6765.0)247 self.assertEqual(payment.amount_auth, 7865.0) 232 248 self.assertEqual(payment.p_item, u'CERT1') 233 249 self.assertEqual(error, None) -
main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py
r8954 r8961 88 88 payment_allowed = True 89 89 amount = academic_session.school_fee_base 90 elif student.state == RETURNING: 91 p_session, p_level = self.getReturningData(student) 90 elif student.state == RETURNING or\ 91 (student.is_postgrad and student.state == PAID): 92 if student.state == RETURNING: 93 p_session, p_level = self.getReturningData(student) 94 else: 95 # Returning postgraduate students also pay for the 96 # next session but their level always remains the same. 97 p_session += 1 92 98 initial_instalment_made = False 93 99 for key in student['payments'].keys(): … … 103 109 if not initial_instalment_made: 104 110 payment_allowed = True 111 try: 112 academic_session = grok.getSite()[ 113 'configuration'][str(p_session)] 114 except KeyError: 115 return _(u'Session configuration object is not available.'), None 105 116 amount = academic_session.school_fee_base 106 117 else:
Note: See TracChangeset for help on using the changeset viewer.