Skip to content

Two assertions encode the reference merchant's currency and tax treatment #103

Description

@BrocksiNet

Follow-up to #101. Two assertions hold only for a merchant that trades in a particular currency and charges no tax.

1. The idempotency conflict payload is a no-op for EUR merchants

idempotency_test.py::test_idempotency_create sends a request, replays it, then sends a "conflicting" one under the same key expecting 409:

conflict_payload = create_payload.model_copy(deep=True)
conflict_payload.currency = "EUR"

The original payload's currency comes from conformance_input.json. For a merchant that declares EUR the conflict payload is byte-identical to the original, so a correct server replays it and answers 200/201 — exactly as the preceding assertion required. The test can only pass for a merchant that does not trade in EUR.

Patch derives a value that actually differs:
0006-idempotency-conflict-must-differ.patch

2. test_fulfillment_flow assumes the business charges no tax

expected_total = self.fixture_ctx.get_test_price() + option_cost  # base price + shipping

This asserts the grand total is item price plus shipping, which holds only where nothing else is added.

The suite models tax correctly everywhere else, and contradicts itself here:

  • totals_test.py lists tax and fee in _ADDITIVE_TYPES as valid additive entries
  • business_logic_test.py verifies the total by summing every non-total entry

So a merchant charging VAT — ours is a German business at 19% — passes the arithmetic checks in both of those and fails this one.

Patch sums the entries the way business_logic_test already does:
0007-sum-totals-instead-of-assuming.patch

Both verified: with these applied, idempotency_test and fulfillment_test go green against an independent merchant.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions