From e7712e0c9b9f2bc10893837f04348829611bf6d4 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 4 Sep 2019 18:17:30 +0500 Subject: [PATCH] BOM-169 python3 tests failures. --- lms/djangoapps/shoppingcart/tests/payment_fake.py | 2 +- lms/djangoapps/shoppingcart/tests/test_payment_fake.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lms/djangoapps/shoppingcart/tests/payment_fake.py b/lms/djangoapps/shoppingcart/tests/payment_fake.py index fb8be056f2..e1847d61e3 100644 --- a/lms/djangoapps/shoppingcart/tests/payment_fake.py +++ b/lms/djangoapps/shoppingcart/tests/payment_fake.py @@ -77,7 +77,7 @@ class PaymentFakeView(View): Accepts one POST param "status" that can be either "success" or "failure". """ - new_status = request.body + new_status = request.body.decode('utf-8') if new_status not in ["success", "failure", "decline"]: return HttpResponseBadRequest() diff --git a/lms/djangoapps/shoppingcart/tests/test_payment_fake.py b/lms/djangoapps/shoppingcart/tests/test_payment_fake.py index b53def9004..5b87f62c70 100644 --- a/lms/djangoapps/shoppingcart/tests/test_payment_fake.py +++ b/lms/djangoapps/shoppingcart/tests/test_payment_fake.py @@ -57,7 +57,7 @@ class PaymentFakeViewTest(TestCase): # Expect that we were served the payment page # (not the error page) - self.assertIn("Payment Form", resp.content) + self.assertIn("Payment Form", resp.content.decode('utf-8')) def test_rejects_invalid_signature(self): @@ -74,7 +74,7 @@ class PaymentFakeViewTest(TestCase): ) # Expect that we got an error - self.assertIn("Error", resp.content) + self.assertIn("Error", resp.content.decode('utf-8')) def test_sends_valid_signature(self): @@ -95,7 +95,6 @@ class PaymentFakeViewTest(TestCase): # Generate shoppingcart signatures post_params = sign(self.client_post_params) - # Configure the view to declined payments resp = self.client.put( '/shoppingcart/payment_fake',