Skip to content

[Bug]: IntegrationTestBase.update_checkout_session drops buyer identity, breaking known-customer address injection #24

@donbenny0

Description

@donbenny0

What happened?

Summary

update_checkout_session in conformance/integration_test_utils.py does not carry the
buyer information from the current checkout object into the update payload when no explicit
buyer argument is provided. As a result, the PUT request is sent without a buyer field,
which prevents the server from identifying the customer and injecting their stored addresses.

Affected test

fulfillment_test.py::FulfillmentTest::test_known_customer_one_address
fulfillment_test.py::FulfillmentTest::test_known_customer_multiple_addresses_selection
and even more...

Root cause

update_checkout_session defaults currency, line_items, and payment from
checkout_obj when they are not explicitly provided, but omits this fallback for buyer:

Existing — correctly falls back for currency

currency = currency if currency is not None else checkout_obj.currency

Missing — buyer is left as None even when checkout_obj.buyer is set

update_payload = UnifiedUpdate(
...
buyer=buyer, # always None unless caller passes it explicitly
...
)
Because the payload is serialised with exclude_none=True, the buyer key is completely
absent from the PUT request body. The server receives no buyer identity and cannot look up
John Doe's stored addresses, so the address injection never happens and the assertions at
lines 252-255 fail.

Expected behaviour

buyer should fall back to checkout_obj.buyer when no override is passed, consistent
with how currency, line_items, and payment are handled.

Logs as images

checkout_obj
Image

update_payload in IntegrationTestBase.update_checkout_session

Image

Fix

buyer = buyer if buyer is not None else checkout_obj.buyer

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions