- Timestamp:
- 22 Mar 2019, 07:05:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.dspg/trunk/src/kofacustom/dspg/students/tests/test_utils.py
r15345 r15360 66 66 self.assertEqual(msg, None) 67 67 return 68 69 def test_set_payment_details(self): 70 self.student['studycourse'].certificate.school_fee_1 = 6666.0 71 self.student['studycourse'].certificate.school_fee_2 = 7777.0 72 self.student['studycourse'].certificate.school_fee_3 = 8888.0 73 self.student['studycourse'].certificate.school_fee_4 = 9999.0 74 self.student['studycourse'].certificate.study_mode = 'hnd_ft' 75 self.student.nationality = u'NG' 76 self.student.lga = 'ebonyi_ukaba' 77 utils = getUtility(IStudentsUtils) 78 configuration = createObject('waeup.SessionConfiguration') 79 configuration.academic_session = 2005 80 self.app['configuration'].addSessionConfiguration(configuration) 81 error, payment = utils.setPaymentDetails('dep_sug',self.student) 82 self.assertEqual(payment.p_level, 100) 83 self.assertEqual(payment.p_session, 2004) 84 IWorkflowState(self.student).setState('returning') 85 # Returning students are paying for next session 86 error, payment = utils.setPaymentDetails('dep_sug',self.student) 87 self.assertEqual(payment.p_level, 200) 88 self.assertEqual(payment.p_session, 2005) 89 self.assertEqual(payment.amount_auth, 3150.0) 90 # Students can pay school fee if dep_sug has been paid first. 91 error, payment = utils.setPaymentDetails('schoolfee',self.student) 92 self.assertEqual(error, u'You have to pay NADESU/SA/SUG Dues first.') 93 error, payment = utils.setPaymentDetails('dep_sug',self.student) 94 self.student['payments']['any_key'] = payment 95 error, payment = utils.setPaymentDetails('schoolfee',self.student) 96 self.assertEqual(error, u'You have to pay NADESU/SA/SUG Dues first.') 97 self.student['payments']['any_key'].p_state = 'paid' 98 error, payment = utils.setPaymentDetails('schoolfee',self.student) 99 self.assertEqual(error, None) 100 self.assertEqual(payment.p_level, 200) 101 self.assertEqual(payment.p_session, 2005) 102 self.assertEqual(payment.amount_auth, 9999.0) 103
Note: See TracChangeset for help on using the changeset viewer.