mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 14:13:21 +00:00
eboutic: change HTTP return code to avoid blaming the bank's service
This commit is contained in:
parent
b20df930a2
commit
c2e0ea70e4
@ -191,10 +191,10 @@ class EbouticTest(TestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
response = self.generate_bank_valid_answer_from_page_content(response.content)
|
response = self.generate_bank_valid_answer_from_page_content(response.content)
|
||||||
self.assertTrue(response.status_code == 400)
|
self.assertEqual(response.status_code, 500)
|
||||||
self.assertTrue(
|
self.assertIn(
|
||||||
"Payment failed with error: SuspiciousOperation('Basket total and amount do not match'"
|
"Basket processing failed with error: SuspiciousOperation('Basket total and amount do not match'",
|
||||||
in response.content.decode("utf-8")
|
response.content.decode("utf-8"),
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_buy_refill_product_with_credit_card(self):
|
def test_buy_refill_product_with_credit_card(self):
|
||||||
|
@ -301,9 +301,11 @@ class EtransactionAutoAnswer(View):
|
|||||||
i.validate()
|
i.validate()
|
||||||
b.delete()
|
b.delete()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return HttpResponse("Payment failed with error: " + repr(e), status=400)
|
return HttpResponse(
|
||||||
|
"Basket processing failed with error: " + repr(e), status=500
|
||||||
|
)
|
||||||
return HttpResponse()
|
return HttpResponse()
|
||||||
else:
|
else:
|
||||||
return HttpResponse(
|
return HttpResponse(
|
||||||
"Payment failed with error: " + request.GET["Error"], status=400
|
"Payment failed with error: " + request.GET["Error"], status=202
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user