Changeset 9713 for main/waeup.uniben/trunk/src/waeup/uniben/interswitch
- Timestamp:
- 23 Nov 2012, 07:58:22 (12 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/interswitch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser.py
r9636 r9713 21 21 from xml.dom.minidom import parseString 22 22 import grok 23 from zope.event import notify 23 24 from zope.component import getUtility 24 25 from waeup.kofa.browser.layout import KofaPage, UtilityView … … 105 106 payment.p_category, payment.p_id, sr) 106 107 payment.p_state = 'failed' 108 notify(grok.ObjectModifiedEvent(payment)) 107 109 return False, msg, log 108 110 if payment.r_amount_approved != payment.amount_auth: … … 111 113 payment.p_category, payment.p_id, sr) 112 114 payment.p_state = 'failed' 115 notify(grok.ObjectModifiedEvent(payment)) 113 116 return False, msg, log 114 117 if wlist[4] != payment.p_id: … … 117 120 payment.p_category, payment.p_id, sr) 118 121 payment.p_state = 'failed' 122 notify(grok.ObjectModifiedEvent(payment)) 119 123 return False, msg, log 120 124 payment.p_state = 'paid' … … 123 127 log = 'valid callback for %s payment %s: %s' % ( 124 128 payment.p_category, payment.p_id, sr) 129 notify(grok.ObjectModifiedEvent(payment)) 125 130 return True, msg, log 126 131 -
main/waeup.uniben/trunk/src/waeup/uniben/interswitch/tests.py
r9570 r9713 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 from zope.component import createObject 18 from zope.component import createObject, getUtility 19 from zope.catalog.interfaces import ICatalog 19 20 from hurry.workflow.interfaces import IWorkflowState 20 21 from waeup.kofa.students.tests.test_browser import StudentsFullSetup … … 215 216 self.assertMatches('...Unsuccessful callback...', 216 217 self.browser.contents) 217 # The payment is now in state failed 218 # The payment is now in state failed ... 218 219 self.assertMatches('...<span>Failed</span>...', 219 220 self.browser.contents) 221 # ... and the catalog has been updated 222 cat = getUtility(ICatalog, name='payments_catalog') 223 results = list( 224 cat.searchResults(p_state=('failed', 'failed'))) 225 self.assertEqual(len(results), 1) 226 self.assertEqual(results[0].p_state, 'failed') 220 227 221 228 class InterswitchTestsApplicants(ApplicantsFullSetup):
Note: See TracChangeset for help on using the changeset viewer.