Commit bbff0a45 authored by Jérome Perrin's avatar Jérome Perrin

stripe: fix test (ok for py2)

parent b7b4ac43
...@@ -461,8 +461,8 @@ class TestStripePaymentSession(ERP5TypeTestCase): ...@@ -461,8 +461,8 @@ class TestStripePaymentSession(ERP5TypeTestCase):
) )
ret = self.publish( ret = self.publish(
"%s/ERP5Site_receiveStripeWebHook" % self.portal.getPath(), "%s/ERP5Site_receiveStripeWebHook" % self.portal.getPath(),
stdin=BytesIO(urllib.parse.urlencode({ stdin=BytesIO(
"BODY": json.dumps({ json.dumps({
"url": "https://stripe.url", "url": "https://stripe.url",
"id": "evt_%s" % "abc321_expired", "id": "evt_%s" % "abc321_expired",
"object": "event", "object": "event",
...@@ -474,8 +474,8 @@ class TestStripePaymentSession(ERP5TypeTestCase): ...@@ -474,8 +474,8 @@ class TestStripePaymentSession(ERP5TypeTestCase):
"object": "checkout.session" "object": "checkout.session"
} }
} }
}) }).encode()
}).encode()), ),
request_method="POST", request_method="POST",
handle_errors=False) handle_errors=False)
self.assertEqual(200, ret.getStatus()) self.assertEqual(200, ret.getStatus())
...@@ -658,8 +658,8 @@ class TestStripePaymentSession(ERP5TypeTestCase): ...@@ -658,8 +658,8 @@ class TestStripePaymentSession(ERP5TypeTestCase):
) )
ret = self.publish( ret = self.publish(
"%s/ERP5Site_receiveStripeWebHook" % self.portal.getPath(), "%s/ERP5Site_receiveStripeWebHook" % self.portal.getPath(),
stdin=BytesIO(urllib.parse.urlencode({ stdin=BytesIO(
"BODY": json.dumps({ json.dumps({
"id": "evt_%s" % session_id, "id": "evt_%s" % session_id,
"object": "event", "object": "event",
"data": { "data": {
...@@ -670,8 +670,8 @@ class TestStripePaymentSession(ERP5TypeTestCase): ...@@ -670,8 +670,8 @@ class TestStripePaymentSession(ERP5TypeTestCase):
"object": "checkout.session" "object": "checkout.session"
} }
} }
}) }).encode(),
}).encode()), ),
request_method="POST", request_method="POST",
handle_errors=False) handle_errors=False)
self.assertEqual(200, ret.getStatus()) self.assertEqual(200, ret.getStatus())
......
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