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): ...@@ -103,6 +103,8 @@ class PaypalService(XMLObject):
request.add_header("Content-type", "application/x-www-form-urlencoded") request.add_header("Content-type", "application/x-www-form-urlencoded")
response = urlopen(request) response = urlopen(request)
status = response.read() status = response.read()
method = self._getTypeBasedMethod("reportPaymentStatus")
LOG("PaypalService status", DEBUG, status) LOG("PaypalService status", DEBUG, status)
self._getTypeBasedMethod("reportPaymentStatus")(REQUEST=REQUEST) if method and status == "VERIFIED":
return status == "VERIFIED" method(REQUEST=REQUEST)
\ No newline at end of file return True
\ No newline at end of file
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
############################################################################## ##############################################################################
import random import random
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase, get_request from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
def getMessageList(o): def getMessageList(o):
...@@ -98,17 +98,4 @@ business=business@sample.com""") ...@@ -98,17 +98,4 @@ business=business@sample.com""")
finally: finally:
self.portal.portal_skins.custom.manage_delObjects([pt_id]) self.portal.portal_skins.custom.manage_delObjects([pt_id])
# flush skin cache # flush skin cache
self.portal.changeSkin(None) self.portal.changeSkin(None)
\ No newline at end of file
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
3 2
\ No newline at end of file \ 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