Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions fulfillment_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
)
Expand Down
9 changes: 8 additions & 1 deletion idempotency_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Loading