Changeset 9251 for main/waeup.uniben/trunk/src/waeup/uniben/students/tests
- Timestamp:
- 28 Sep 2012, 06:22:59 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
r9210 r9251 73 73 layer = FunctionalLayer 74 74 75 def test_next_session_allowed(self): 76 # Let's see if next_session_allowed works as expected 77 # A, ug_ft, 100 78 IWorkflowState(self.student).setState('returning') 79 self.assertTrue(self.student['studycourse'].next_session_allowed) 80 # Uniben special PG programmes have the same workflow 81 # as UG students 82 self.certificate.study_mode = 'special_pg_pt' 83 self.assertTrue(self.student['studycourse'].next_session_allowed) 84 IWorkflowState(self.student).setState('school fee paid') 85 self.assertFalse(self.student['studycourse'].next_session_allowed) 86 # Now we convert the certificate into a 'regular 87 # postgraduate certificate ... 88 self.certificate.study_mode = 'pg_ft' 89 # ... and voila next session registration is allowed 90 self.assertTrue(self.student['studycourse'].next_session_allowed) 91 92 def test_manage_access(self): 93 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 94 # The student created in the base package is a ug student 95 self.browser.open(self.manage_clearance_path) 96 self.assertMatches('...First Sitting Record...', 97 self.browser.contents) 98 # There is no pg field in the clearance form 99 self.assertFalse('Second Higher Education Record' 100 in self.browser.contents) 101 # Now we change the study mode ... 102 self.certificate.study_mode = 'pg_ft' 103 self.browser.open(self.clearance_path) 104 # ... and additional pg clearance fields appear 105 self.assertMatches('...Second Higher Education Record...', 106 self.browser.contents) 107 # But also fields from the ug form are displayed 108 self.assertMatches('...First Sitting Record...', 109 self.browser.contents) 110 # The same holds for Uniben's special pg students 111 self.certificate.study_mode = 'special_pg_ft' 112 self.browser.open(self.clearance_path) 113 self.assertMatches('...Second Higher Education Record...', 114 self.browser.contents) 115 self.assertMatches('...First Sitting Record...', 116 self.browser.contents) 117 75 118 def test_manage_payments(self): 76 119 # Add missing configuration data … … 301 344 self.assertEqual(payment.p_item, u'CERT1') 302 345 self.assertEqual(error, None) 303 304 346 self.student.is_staff = True 305 347 error, payment = utils.setPaymentDetails('schoolfee', … … 332 374 self.assertEqual(payment.p_session, 2005) 333 375 self.assertEqual(payment.amount_auth, 20088.0) 376 self.assertEqual(payment.p_item, u'CERT1') 377 self.assertEqual(error, None) 378 379 # In Uniben we have pg and special pg students. 380 # They pay the same but their workflow is different. 381 IWorkflowState(self.student).setState('school fee paid') 382 self.student.is_staff = False 383 self.student.nationality = u'NG' 384 self.certificate.school_fee_2 = 10000.0 385 error, payment = utils.setPaymentDetails( 386 'schoolfee', self.student, None, None) 387 self.assertEqual(payment, None) 388 self.assertTrue('not be determined' in error) 389 self.certificate.study_mode = 'pg_pt' 390 self.assertTrue(self.student.is_postgrad) 391 self.assertFalse(self.student.is_special_postgrad) 392 error, payment = utils.setPaymentDetails( 393 'schoolfee', self.student, None, None) 394 self.assertEqual(payment.p_level, 100) 395 self.assertEqual(payment.p_session, 2005) 396 self.assertEqual(payment.amount_auth, 10000.0) 397 self.assertEqual(payment.p_item, u'CERT1') 398 self.assertEqual(error, None) 399 self.certificate.study_mode = 'special_pg_pt' 400 self.assertTrue(self.student.is_postgrad) 401 self.assertTrue(self.student.is_special_postgrad) 402 error, payment = utils.setPaymentDetails( 403 'schoolfee', self.student, None, None) 404 self.assertTrue('not be determined' in error) 405 IWorkflowState(self.student).setState('returning') 406 error, payment = utils.setPaymentDetails( 407 'schoolfee', self.student, None, None) 408 self.assertEqual(payment.p_level, 200) 409 self.assertEqual(payment.p_session, 2005) 410 self.assertEqual(payment.amount_auth, 10000.0) 334 411 self.assertEqual(payment.p_item, u'CERT1') 335 412 self.assertEqual(error, None)
Note: See TracChangeset for help on using the changeset viewer.