From 0b89ab2bb3833ef67309bcace4751aca816a5fe8 Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Mon, 22 Dec 2025 15:32:55 -0500 Subject: [PATCH] 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 --- make_post_sell/tests/test_functional.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/make_post_sell/tests/test_functional.py b/make_post_sell/tests/test_functional.py index 434784a..93f626f 100644 --- a/make_post_sell/tests/test_functional.py +++ b/make_post_sell/tests/test_functional.py @@ -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):