Changeset 9152 for main/waeup.uniben/trunk/src/waeup/uniben/students/tests
- Timestamp:
- 4 Sep 2012, 07:06:20 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
r9006 r9152 221 221 utils = getUtility(IStudentsUtils) 222 222 223 self.student.nationality = u'NG' 224 223 225 configuration = createObject('waeup.SessionConfiguration') 224 226 configuration.academic_session = 2005 225 227 self.app['configuration'].addSessionConfiguration(configuration) 226 228 227 error, payment = utils.setPaymentDetails('schoolfee',self.student) 229 error, payment = utils.setPaymentDetails('schoolfee', 230 self.student, None, None) 228 231 self.assertEqual(payment, None) 229 self.assertEqual(error, u'Amount could not be determined.') 230 232 self.assertTrue(u'Amount could not be determined.' in error) 233 234 # Previous session payment, fresh and returning 235 # are being distinguished by their entry_level 236 error, payment = utils.setPaymentDetails('schoolfee', 237 self.student, 2004, 300) 238 self.assertEqual(payment.amount_auth, 40000.0) 239 self.assertEqual(payment.p_session, 2004) 240 self.assertEqual(payment.p_level, 300) 241 self.assertFalse(payment.p_current) 242 self.student['studycourse'].entry_session = 2003 243 error, payment = utils.setPaymentDetails('schoolfee', 244 self.student, 2004, 300) 245 self.assertEqual(payment.amount_auth, 20000.0) 246 self.assertEqual(payment.p_session, 2004) 247 self.assertEqual(payment.p_level, 300) 248 self.assertFalse(payment.p_current) 249 250 # Current payment, fresh and returning 251 # are being distinguished by their state 231 252 IWorkflowState(self.student).setState('cleared') 232 self.student.nationality = u'NG'233 error, payment = utils.setPaymentDetails('schoolfee',self.student)253 error, payment = utils.setPaymentDetails('schoolfee', 254 self.student, None, None) 234 255 self.assertEqual(payment.p_level, 100) 235 256 self.assertEqual(payment.p_session, 2004) … … 237 258 self.assertEqual(payment.p_item, u'CERT1') 238 259 self.assertEqual(error, None) 260 self.assertTrue(payment.p_current) 239 261 240 262 # Add penalty fee ... … … 243 265 # ... for returning 244 266 self.app['configuration']['2005'].penalty_ug = 88.0 245 error, payment = utils.setPaymentDetails('schoolfee',self.student) 267 error, payment = utils.setPaymentDetails('schoolfee', 268 self.student, None, None) 246 269 self.assertEqual(payment.amount_auth, 40099.0) 247 270 248 271 IWorkflowState(self.student).setState('returning') 249 error, payment = utils.setPaymentDetails('schoolfee',self.student) 272 error, payment = utils.setPaymentDetails('schoolfee', 273 self.student, None, None) 250 274 self.assertEqual(payment.p_level, 200) 251 275 self.assertEqual(payment.p_session, 2005) … … 255 279 256 280 self.student.is_staff = True 257 error, payment = utils.setPaymentDetails('schoolfee',self.student) 281 error, payment = utils.setPaymentDetails('schoolfee', 282 self.student, None, None) 258 283 self.assertEqual(payment.p_level, 200) 259 284 self.assertEqual(payment.p_session, 2005) … … 266 291 self.student.nationality = u'DE' 267 292 self.certificate.school_fee_3 = 60000.0 268 error, payment = utils.setPaymentDetails('schoolfee',self.student) 293 error, payment = utils.setPaymentDetails( 294 'schoolfee', self.student, None, None) 269 295 self.assertEqual(payment.p_level, 100) 270 296 self.assertEqual(payment.p_session, 2004) … … 277 303 self.student.nationality = u'DE' 278 304 self.certificate.school_fee_4 = 20000.0 279 error, payment = utils.setPaymentDetails('schoolfee',self.student) 305 error, payment = utils.setPaymentDetails( 306 'schoolfee', self.student, None, None) 280 307 self.assertEqual(payment.p_level, 200) 281 308 self.assertEqual(payment.p_session, 2005) … … 284 311 self.assertEqual(error, None) 285 312 286 error, payment = utils.setPaymentDetails('clearance',self.student) 313 error, payment = utils.setPaymentDetails('clearance', 314 self.student, None, None) 287 315 self.assertEqual(payment.p_level, 100) 288 316 self.assertEqual(payment.p_session, 2004) … … 291 319 self.assertEqual(error, None) 292 320 293 error, payment = utils.setPaymentDetails('gown',self.student) 321 error, payment = utils.setPaymentDetails('gown', 322 self.student, None, None) 294 323 self.assertEqual(payment.p_level, 100) 295 324 self.assertEqual(payment.p_session, 2004) … … 298 327 self.assertEqual(error, None) 299 328 300 error, payment = utils.setPaymentDetails('hostel_maintenance',self.student) 329 error, payment = utils.setPaymentDetails('hostel_maintenance', 330 self.student, None, None) 301 331 self.assertEqual(payment.p_level, 100) 302 332 self.assertEqual(payment.p_session, 2004) … … 305 335 self.assertEqual(error, None) 306 336 307 error, payment = utils.setPaymentDetails('bed_allocation',self.student) 337 error, payment = utils.setPaymentDetails('bed_allocation', 338 self.student, None, None) 308 339 self.assertEqual(payment.p_level, 100) 309 340 self.assertEqual(payment.p_session, 2004) … … 312 343 self.assertEqual(error, None) 313 344 314 error, payment = utils.setPaymentDetails('transfer',self.student) 345 error, payment = utils.setPaymentDetails('transfer', 346 self.student, None, None) 315 347 self.assertEqual(payment.p_level, 100) 316 348 self.assertEqual(payment.p_session, 2004)
Note: See TracChangeset for help on using the changeset viewer.