Changeset 9710 for main/waeup.kwarapoly/trunk/src/waeup/kwarapoly
- Timestamp:
- 23 Nov 2012, 06:53:18 (12 years ago)
- Location:
- main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/browser.py
r9626 r9710 22 22 from xml.dom.minidom import parseString 23 23 import grok 24 from zope.event import notify 24 25 from zope.interface import Interface 25 26 from zope.component import getUtility, queryAdapter … … 109 110 payment.p_category, payment.p_id, sr) 110 111 payment.p_state = 'failed' 112 notify(grok.ObjectModifiedEvent(payment)) 111 113 return False, msg, log 112 114 if payment.r_amount_approved != payment.amount_auth: … … 115 117 payment.p_category, payment.p_id, sr) 116 118 payment.p_state = 'failed' 119 notify(grok.ObjectModifiedEvent(payment)) 117 120 return False, msg, log 118 121 if wlist[4] != payment.p_id: … … 121 124 payment.p_category, payment.p_id, sr) 122 125 payment.p_state = 'failed' 126 notify(grok.ObjectModifiedEvent(payment)) 123 127 return False, msg, log 124 128 payment.p_state = 'paid' … … 127 131 log = 'valid callback for %s payment %s: %s' % ( 128 132 payment.p_category, payment.p_id, sr) 133 notify(grok.ObjectModifiedEvent(payment)) 129 134 return True, msg, log 130 135 -
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/tests.py
r9626 r9710 18 18 import grok 19 19 from hurry.workflow.interfaces import IWorkflowState 20 from zope.component import createObject 20 from zope.component import createObject, getUtility 21 from zope.catalog.interfaces import ICatalog 21 22 from zope.event import notify 22 23 from waeup.kofa.university.faculty import Faculty … … 206 207 self.assertMatches('...Unsuccessful callback...', 207 208 self.browser.contents) 208 # The payment is now in state failed 209 # The payment is now in state failed ... 209 210 self.assertMatches('...<span>Failed</span>...', 210 211 self.browser.contents) 212 # ... and the catalog has been updated 213 cat = getUtility(ICatalog, name='payments_catalog') 214 results = list( 215 cat.searchResults(p_state=('failed', 'failed'))) 216 self.assertEqual(len(results), 1) 217 self.assertEqual(results[0].p_state, 'failed') 211 218 212 219 class InterswitchTestsApplicants(ApplicantsFullSetup):
Note: See TracChangeset for help on using the changeset viewer.