Changeset 9206
- Timestamp:
- 19 Sep 2012, 14:24:46 (12 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
r9157 r9206 219 219 self.app['configuration']['2004'].booking_fee = 150.0 220 220 self.app['configuration']['2004'].maint_fee = 180.0 221 222 configuration = createObject('waeup.SessionConfiguration') 223 configuration.academic_session = 2000 224 self.app['configuration'].addSessionConfiguration(configuration) 225 configuration2 = createObject('waeup.SessionConfiguration') 226 configuration2.academic_session = 2002 227 self.app['configuration'].addSessionConfiguration(configuration2) 228 configuration3 = createObject('waeup.SessionConfiguration') 229 configuration3.academic_session = 2003 230 self.app['configuration'].addSessionConfiguration(configuration3) 231 221 232 utils = getUtility(IStudentsUtils) 222 233 234 self.student['studycourse'].entry_session = 2002 223 235 self.student.nationality = u'NG' 224 236 … … 232 244 self.assertTrue(u'Amount could not be determined.' in error) 233 245 246 # Previous session must be valid. 247 error, payment = utils.setPaymentDetails('schoolfee', 248 self.student, 2000, 300) 249 self.assertEqual(payment, None) 250 self.assertTrue(u'The previous session must not fall below' in error) 251 error, payment = utils.setPaymentDetails('schoolfee', 252 self.student, 2004, 300) 253 self.assertEqual(payment, None) 254 self.assertTrue(u'This is not a previous session' in error) 255 234 256 # Previous session payment; fresh and returning 235 257 # are distinguished by their entry_level 236 258 error, payment = utils.setPaymentDetails('schoolfee', 237 self.student, 200 4, 300)259 self.student, 2002, 300) 238 260 self.assertEqual(payment.amount_auth, 40000.0) 239 self.assertEqual(payment.p_session, 200 4)261 self.assertEqual(payment.p_session, 2002) 240 262 self.assertEqual(payment.p_level, 300) 241 263 self.assertFalse(payment.p_current) 242 264 error, payment = utils.setPaymentDetails('schoolfee', 243 self.student, 200 5, 300)265 self.student, 2003, 300) 244 266 self.assertEqual(payment.amount_auth, 20000.0) 245 self.assertEqual(payment.p_session, 200 5)267 self.assertEqual(payment.p_session, 2003) 246 268 self.assertEqual(payment.p_level, 300) 247 269 self.assertFalse(payment.p_current) -
main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py
r9157 r9206 97 97 return _('Study course data are incomplete.'), None 98 98 if previous_session: 99 if previous_session < student['studycourse'].entry_session: 100 return _('The previous session must not fall below ' 101 'your entry session.'), None 102 if previous_session > student['studycourse'].current_session - 1: 103 return _('This is not a previous session.'), None 99 104 if previous_session == student['studycourse'].entry_session: 100 105 if student.is_foreigner:
Note: See TracChangeset for help on using the changeset viewer.