diff --git a/fulfillment_test.py b/fulfillment_test.py index 3a2e8fa..732e242 100644 --- a/fulfillment_test.py +++ b/fulfillment_test.py @@ -156,9 +156,6 @@ def test_fulfillment_flow(self) -> None: # 2. Select Option option_id = options[0]["id"] - option_cost = next( - (t["amount"] for t in options[0]["totals"] if t["type"] == "total"), 0 - ) # Update payload to select the option # We must preserve the destination to keep options available @@ -175,9 +172,9 @@ def test_fulfillment_flow(self) -> None: ) final_checkout = checkout.Checkout(**response_json) - expected_total = ( - self.fixture_ctx.get_test_price() + option_cost - ) # base price + shipping + expected_total = sum( + total.amount for total in final_checkout.totals if total.type != "total" + ) total_obj = next( (t for t in final_checkout.totals if t.type == "total"), None ) diff --git a/idempotency_test.py b/idempotency_test.py index a1b8fb3..5b91440 100644 --- a/idempotency_test.py +++ b/idempotency_test.py @@ -80,7 +80,14 @@ def test_idempotency_create(self) -> None: # 3. Conflict Request conflict_payload = create_payload.model_copy(deep=True) - conflict_payload.currency = "EUR" + # Pick any currency other than the merchant's own so the conflict + # request differs for every conformance input (a hardcoded "EUR" is a + # no-op for merchants that already trade in EUR). + conflict_payload.currency = next( + code + for code in ("EUR", "USD", "GBP", "JPY") + if code != create_payload.currency + ) response3 = self.client.post( self.get_shopping_url("/checkout-sessions"), json=conflict_payload.model_dump(