Changeset 7322 for main/waeup.sirp/trunk/src/waeup
- Timestamp:
- 10 Dec 2011, 06:38:34 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/applicants
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
r7321 r7322 25 25 from zope.component import getUtility, createObject 26 26 from zope.formlib.form import setUpEditWidgets 27 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 27 from hurry.workflow.interfaces import ( 28 IWorkflowInfo, IWorkflowState, InvalidTransitionError) 28 29 from reportlab.pdfgen import canvas 29 30 from reportlab.lib.units import cm … … 593 594 # from the incoming request. 594 595 def update(self): 595 if self.context.p_state == 'paid': 596 self.flash('This ticket has already been paid.') 596 self.wf_info = IWorkflowInfo(self.context.__parent__) 597 try: 598 self.wf_info.fireTransition('pay') 599 except InvalidTransitionError: 600 self.flash('Error: %s' % sys.exc_info()[1]) 597 601 return 598 602 self.context.r_amount_approved = self.context.amount_auth … … 604 608 self.context.__parent__.loggerInfo( 605 609 ob_class, 'valid callback: %s' % self.context.p_id) 606 self.wf_info = IWorkflowInfo(self.context.__parent__)607 self.wf_info.fireTransition('pay')608 610 self.flash('Valid callback received.') 609 611 return -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_browser.py
r7270 r7322 619 619 # Callback can't be applied twice 620 620 self.browser.open(payment_url + '/callback') 621 self.assertMatches('...This ticket has already been paid...', 622 self.browser.contents) 621 self.assertMatches( 622 "...Transition 'pay' requires 'started' as source state...", 623 self.browser.contents) 623 624 # The payment receipt can be downloaded now 624 625 self.browser.open(payment_url)
Note: See TracChangeset for help on using the changeset viewer.