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

stripe: fix test (ok for py2)

parent 1a65ad27
...@@ -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,9 +474,10 @@ class TestStripePaymentSession(ERP5TypeTestCase): ...@@ -474,9 +474,10 @@ class TestStripePaymentSession(ERP5TypeTestCase):
"object": "checkout.session" "object": "checkout.session"
} }
} }
}) }).encode()
}).encode()), ),
request_method="POST", request_method="POST",
env={'CONTENT_TYPE': 'application/json'},
handle_errors=False) handle_errors=False)
self.assertEqual(200, ret.getStatus()) self.assertEqual(200, ret.getStatus())
self.tic() self.tic()
...@@ -658,8 +659,8 @@ class TestStripePaymentSession(ERP5TypeTestCase): ...@@ -658,8 +659,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,9 +671,10 @@ class TestStripePaymentSession(ERP5TypeTestCase): ...@@ -670,9 +671,10 @@ class TestStripePaymentSession(ERP5TypeTestCase):
"object": "checkout.session" "object": "checkout.session"
} }
} }
}) }).encode(),
}).encode()), ),
request_method="POST", request_method="POST",
env={'CONTENT_TYPE': 'application/json'},
handle_errors=False) handle_errors=False)
self.assertEqual(200, ret.getStatus()) self.assertEqual(200, ret.getStatus())
self.tic() self.tic()
......
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