Changeset 9148 for main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Timestamp:
- 3 Sep 2012, 14:47:24 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r9139 r9148 1575 1575 return 1576 1576 1577 def test_postgraduate_payments(self): 1577 def test_student_previous_payments(self): 1578 # Login 1579 self.browser.open(self.login_path) 1580 self.browser.getControl(name="form.login").value = self.student_id 1581 self.browser.getControl(name="form.password").value = 'spwd' 1582 self.browser.getControl("Login").click() 1583 1584 # Students can add previous school fee payment tickets in any state. 1585 IWorkflowState(self.student).setState('courses registered') 1586 self.browser.open(self.payments_path) 1587 self.browser.getControl("Add online payment ticket").click() 1588 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 1589 self.browser.getControl("Create ticket").click() 1590 1591 # Amount cannot be determined since the state is not 1592 # 'cleared' or 'returning' 1593 self.assertMatches('...Amount could not be determined...', 1594 self.browser.contents) 1595 self.assertMatches('...Would you like to pay for a previous session?...', 1596 self.browser.contents) 1597 1598 # Previous session payment form is provided 1599 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 1600 self.browser.getControl(name="form.p_session").value = ['2004'] 1601 self.browser.getControl(name="form.p_level").value = ['300'] 1602 self.browser.getControl("Create ticket").click() 1603 self.assertMatches('...ticket created...', 1604 self.browser.contents) 1605 ctrl = self.browser.getControl(name='val_id') 1606 value = ctrl.options[0] 1607 self.browser.getLink(value).click() 1608 self.assertMatches('...Amount Authorized...', 1609 self.browser.contents) 1610 self.assertEqual(self.student['payments'][value].amount_auth, 20000.0) 1611 1612 # Payment session is properly set 1613 self.assertEqual(self.student['payments'][value].p_session, 2004) 1614 self.assertEqual(self.student['payments'][value].p_level, 300) 1615 1616 # We simulate the approval 1617 self.browser.open(self.browser.url + '/fake_approve') 1618 self.assertMatches('...Payment approved...', 1619 self.browser.contents) 1620 1621 # No AC has been created 1622 self.assertEqual(len(self.app['accesscodes']['SFE-0'].keys()), 0) 1623 self.assertTrue(self.student['payments'][value].ac is None) 1624 1625 # Current payment flag is set False 1626 self.assertFalse(self.student['payments'][value].p_current) 1627 return 1628 1629 def test_student_postgraduate_payments(self): 1578 1630 self.certificate.study_mode = 'pg_ft' 1579 1631 self.certificate.start_level = 999 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
r9028 r9148 371 371 self.assertEqual( 372 372 result, 373 'ac,amount_auth,creation_date,p_category,p_ id,'373 'ac,amount_auth,creation_date,p_category,p_current,p_id,' 374 374 'p_item,p_level,p_session,p_state,payment_date,r_amount_approved,' 375 375 'r_code,r_desc,student_id\r\n' 376 376 377 ',0.0,2012-04-01 13:12:01,schoolfee, ,,,,unpaid,,0.0,,,\r\n'377 ',0.0,2012-04-01 13:12:01,schoolfee,1,,,,,unpaid,,0.0,,,\r\n' 378 378 ) 379 379 return … … 389 389 self.assertEqual( 390 390 result, 391 'ac,amount_auth,creation_date,p_category,p_ id,'391 'ac,amount_auth,creation_date,p_category,p_current,p_id,' 392 392 'p_item,p_level,p_session,p_state,payment_date,r_amount_approved,' 393 393 'r_code,r_desc,student_id\r\n' 394 394 395 '666,0.0,2012-04-01 13:12:01,schoolfee, my-id,'395 '666,0.0,2012-04-01 13:12:01,schoolfee,1,my-id,' 396 396 'p-item,100,2012,unpaid,2012-04-01 14:12:01,12.12,' 397 397 'r-code,,A111111\r\n' … … 408 408 self.assertEqual( 409 409 result, 410 'ac,amount_auth,creation_date,p_category,p_ id,'410 'ac,amount_auth,creation_date,p_category,p_current,p_id,' 411 411 'p_item,p_level,p_session,p_state,payment_date,r_amount_approved,' 412 412 'r_code,r_desc,student_id\r\n' 413 413 414 '666,0.0,2012-04-01 13:12:01,schoolfee, my-id,'414 '666,0.0,2012-04-01 13:12:01,schoolfee,1,my-id,' 415 415 'p-item,100,2012,unpaid,2012-04-01 14:12:01,12.12,' 416 416 'r-code,,A111111\r\n' … … 427 427 self.assertEqual( 428 428 result, 429 'ac,amount_auth,creation_date,p_category,p_ id,'429 'ac,amount_auth,creation_date,p_category,p_current,p_id,' 430 430 'p_item,p_level,p_session,p_state,payment_date,r_amount_approved,' 431 431 'r_code,r_desc,student_id\r\n' 432 432 433 '666,0.0,2012-04-01 13:12:01,schoolfee, my-id,'433 '666,0.0,2012-04-01 13:12:01,schoolfee,1,my-id,' 434 434 'p-item,100,2012,unpaid,2012-04-01 14:12:01,12.12,' 435 435 'r-code,,A111111\r\n'
Note: See TracChangeset for help on using the changeset viewer.