Changeset 9006 for main/waeup.uniben/trunk/src/waeup/uniben/students/tests
- Timestamp:
- 16 Jul 2012, 07:36:13 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
r8959 r9006 86 86 self.browser.contents) 87 87 IWorkflowState(self.student).setState('cleared') 88 self.student.nationality = u'NG' 88 89 self.browser.open(self.payments_path + '/addop') 89 90 self.browser.getControl("Create ticket").click() … … 190 191 return 191 192 193 def test_set_returning_data(self): 194 # Student is in level 100, session 2004 with verdict A 195 utils = getUtility(IStudentsUtils) 196 197 utils.setReturningData(self.student) 198 self.assertEqual(self.student['studycourse'].current_session, 2005) 199 self.assertEqual(self.student['studycourse'].current_level, 200) 200 201 self.student['studycourse'].current_session = 2004 202 self.student['studycourse'].current_level = 100 203 self.student['studycourse'].current_verdict = 'C' 204 utils.setReturningData(self.student) 205 self.assertEqual(self.student['studycourse'].current_session, 2005) 206 self.assertEqual(self.student['studycourse'].current_level, 110) 207 208 self.student['studycourse'].current_session = 2004 209 self.student['studycourse'].current_level = 100 210 self.student['studycourse'].current_verdict = 'D' 211 utils.setReturningData(self.student) 212 self.assertEqual(self.student['studycourse'].current_session, 2005) 213 self.assertEqual(self.student['studycourse'].current_level, 100) 214 return 215 192 216 def test_set_payment_details(self): 193 217 self.app['configuration']['2004'].gown_fee = 150.0 … … 206 230 207 231 IWorkflowState(self.student).setState('cleared') 232 self.student.nationality = u'NG' 208 233 error, payment = utils.setPaymentDetails('schoolfee',self.student) 209 234 self.assertEqual(payment.p_level, 100) … … 229 254 self.assertEqual(error, None) 230 255 256 self.student.is_staff = True 257 error, payment = utils.setPaymentDetails('schoolfee',self.student) 258 self.assertEqual(payment.p_level, 200) 259 self.assertEqual(payment.p_session, 2005) 260 self.assertEqual(payment.amount_auth, 10088.0) 261 self.assertEqual(payment.p_item, u'CERT1') 262 self.assertEqual(error, None) 263 264 IWorkflowState(self.student).setState('cleared') 265 self.student.is_staff = False 266 self.student.nationality = u'DE' 267 self.certificate.school_fee_3 = 60000.0 268 error, payment = utils.setPaymentDetails('schoolfee',self.student) 269 self.assertEqual(payment.p_level, 100) 270 self.assertEqual(payment.p_session, 2004) 271 self.assertEqual(payment.amount_auth, 60099.0) 272 self.assertEqual(payment.p_item, u'CERT1') 273 self.assertEqual(error, None) 274 275 IWorkflowState(self.student).setState('returning') 276 self.student.is_staff = False 277 self.student.nationality = u'DE' 278 self.certificate.school_fee_4 = 20000.0 279 error, payment = utils.setPaymentDetails('schoolfee',self.student) 280 self.assertEqual(payment.p_level, 200) 281 self.assertEqual(payment.p_session, 2005) 282 self.assertEqual(payment.amount_auth, 20088.0) 283 self.assertEqual(payment.p_item, u'CERT1') 284 self.assertEqual(error, None) 285 231 286 error, payment = utils.setPaymentDetails('clearance',self.student) 232 287 self.assertEqual(payment.p_level, 100)
Note: See TracChangeset for help on using the changeset viewer.