Merge pull request #21557 from edx/awais786/BOM-169

BOM-169
This commit is contained in:
Awais Qureshi
2019-09-04 20:18:59 +05:00
committed by GitHub
2 changed files with 3 additions and 4 deletions

View File

@@ -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()

View File

@@ -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',