Commit b04eeadf authored by Sebastien Robin's avatar Sebastien Robin

Revert "clean up reportPaymentStatus function on PaypalService to call...

Revert "clean up reportPaymentStatus function on PaypalService to call PaypalService_reportPaymentStatus script regardless of the outcome of the status and added one test to cover this method"

This reverts commit 03e358bc.

One test was failing
parent 03e358bc
......@@ -103,6 +103,8 @@ class PaypalService(XMLObject):
request.add_header("Content-type", "application/x-www-form-urlencoded")
response = urlopen(request)
status = response.read()
method = self._getTypeBasedMethod("reportPaymentStatus")
LOG("PaypalService status", DEBUG, status)
self._getTypeBasedMethod("reportPaymentStatus")(REQUEST=REQUEST)
return status == "VERIFIED"
\ No newline at end of file
if method and status == "VERIFIED":
method(REQUEST=REQUEST)
return True
\ No newline at end of file
......@@ -26,7 +26,7 @@
##############################################################################
import random
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase, get_request
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
def getMessageList(o):
......@@ -98,17 +98,4 @@ business=business@sample.com""")
finally:
self.portal.portal_skins.custom.manage_delObjects([pt_id])
# flush skin cache
self.portal.changeSkin(None)
def test_reportPaymentStatus(self):
script_id = "Base_paymentResponse"
custom_skin = self.portal.portal_skins.custom
custom_skin.manage_addProduct['PythonScripts']\
.manage_addPythonScript(id=script_id)
script = custom_skin[script_id]
script.ZPythonScript_edit('**kw', "if kw.has_key('cmd'):\n return 'VERIFIED'")
self.tic()
script_absolute_url = script.absolute_url()
self.service.edit(link_url_string=script_absolute_url)
response = self.service.reportPaymentStatus(get_request())
self.assertTrue(response)
\ No newline at end of file
self.portal.changeSkin(None)
\ No newline at end of file
3
\ No newline at end of file
2
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment