Changeset 8420 for main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests
- Timestamp:
- 11 May 2012, 14:18:47 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r8406 r8420 696 696 #self.assertMatches('...Ticket not yet paid...', 697 697 # self.browser.contents) 698 # Request callback 699 self.browser.getLink("Request callback").click() 700 self.assertMatches('...Valid callback received...', 701 self.browser.contents) 702 # Callback can't be applied twice 703 self.browser.open(payment_url + '/simulate_callback') 704 self.assertMatches( 705 "...Transition 'pay' requires 'started' as source state...", 706 self.browser.contents) 698 # Approve payment 699 # Applicants can't approve payments 700 self.assertRaises( 701 Unauthorized, self.browser.open, payment_url + '/approve') 702 # We approve the payment by bypassing the view 703 payment_id = self.applicant.keys()[0] 704 payment = self.applicant[payment_id] 705 payment.approve() 707 706 # The payment slip can be downloaded now 708 707 self.browser.open(payment_url) … … 711 710 self.assertEqual(self.browser.headers['Content-Type'], 712 711 'application/pdf') 713 # Applicant is is in state 'paid' 712 # Applicant is is not yet in state 'paid' because it was only 713 # the payment which we set to paid 714 714 self.browser.open(self.view_path) 715 self.assertMatches('... paid...',715 self.assertMatches('...started...', 716 716 self.browser.contents) 717 717 state = IWorkflowState(self.applicant).getState() 718 self.assertTrue(state == 'started') 719 # Let's logout and approve the payment as manager 720 self.browser.getLink("Logout").click() 721 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 722 # First we reset the payment 723 payment.r_amount_approved = 0.0 724 payment.r_code = u'' 725 payment.p_state = 'unpaid' 726 payment.r_desc = u'' 727 payment.payment_date = None 728 self.browser.open(payment_url) 729 self.browser.getLink("Approve payment").click() 730 self.assertEqual(payment.p_state, 'paid') 731 self.assertEqual(payment.r_amount_approved, 200.0) 732 self.assertEqual(payment.r_code, 'AP') 733 state = IWorkflowState(self.applicant).getState() 718 734 self.assertTrue(state == 'paid') 735 return 719 736 720 737 def test_final_submit(self):
Note: See TracChangeset for help on using the changeset viewer.