Changeset 9712 for main/waeup.futminna/trunk/src/waeup
- Timestamp:
- 23 Nov 2012, 07:58:11 (12 years ago)
- Location:
- main/waeup.futminna/trunk/src/waeup/futminna/interswitch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.futminna/trunk/src/waeup/futminna/interswitch/browser.py
r9630 r9712 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.futminna/trunk/src/waeup/futminna/interswitch/tests.py
r9630 r9712 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 from zope.component import getUtility 19 from zope.catalog.interfaces import ICatalog 18 20 from hurry.workflow.interfaces import IWorkflowState 19 21 from waeup.kofa.students.tests.test_browser import StudentsFullSetup … … 160 162 self.assertMatches('...Unsuccessful callback...', 161 163 self.browser.contents) 162 # The payment is now in state failed 164 # The payment is now in state failed ... 163 165 self.assertMatches('...<span>Failed</span>...', 164 166 self.browser.contents) 167 # ... and the catalog has been updated 168 cat = getUtility(ICatalog, name='payments_catalog') 169 results = list( 170 cat.searchResults(p_state=('failed', 'failed'))) 171 self.assertEqual(len(results), 1) 172 self.assertEqual(results[0].p_state, 'failed')
Note: See TracChangeset for help on using the changeset viewer.