Fix test_cart_checkout_for_shop to match current checkout flow

The checkout POST now returns a 200 OK directly (or with different
redirect count), so update the test to:
1. Use a while loop to follow any number of redirects
2. Update assertion text from "Please enter your payment information."
   to "Please confirm your order." to match current UI text
This commit is contained in:
Russell Ballestrini 2025-12-22 15:32:55 -05:00
parent 31592b6923
commit 0b89ab2bb3

View file

@ -560,9 +560,11 @@ class AuthenticatedFunctionalTests(FunctionalTests):
"csrf_token": csrf_token, # Include CSRF token as a form value.
},
)
res_csrf_checkout = res_csrf_checkout.follow().follow()
# Follow any redirects until we get a 200 OK response
while res_csrf_checkout.status_int in (301, 302, 303, 307, 308):
res_csrf_checkout = res_csrf_checkout.follow()
self.assertIn(
"Please enter your payment information.", res_csrf_checkout.body.decode()
"Please confirm your order.", res_csrf_checkout.body.decode()
)
def test_cart_checkout_logic_with_none_stripe_user_shop(self):