Changeset 9711
- Timestamp:
- 23 Nov 2012, 07:57:57 (12 years ago)
- Location:
- main/waeup.fceokene/trunk/src/waeup/fceokene/interswitch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.fceokene/trunk/src/waeup/fceokene/interswitch/browser.py
r9682 r9711 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.fceokene/trunk/src/waeup/fceokene/interswitch/tests.py
r9682 r9711 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 … … 169 171 @external_test 170 172 def test_webservice(self): 171 172 173 self.browser.open(self.payment_url + '/request_webservice') 173 self.assertMatches('...Unsuccessful callback...', 174 self.browser.contents) 175 # The payment is now in state failed 174 #self.assertMatches('...Unsuccessful callback...', 175 # self.browser.contents) 176 self.assertMatches('...Response from Interswitch...', 177 self.browser.contents) 178 # The payment is now in state failed ... 176 179 self.assertMatches('...<span>Failed</span>...', 177 180 self.browser.contents) 181 # ... and the catalog has been updated 182 cat = getUtility(ICatalog, name='payments_catalog') 183 results = list( 184 cat.searchResults(p_state=('failed', 'failed'))) 185 self.assertEqual(len(results), 1) 186 self.assertEqual(results[0].p_state, 'failed') 178 187 179 188 class InterswitchTestsApplicants(ApplicantsFullSetup):
Note: See TracChangeset for help on using the changeset viewer.