Skip to content

test: drive payment tests through bwh_payments stubs - #228

Draft
harshtandiya wants to merge 3 commits into
developfrom
feat/razorpay-services
Draft

harshtandiya wants to merge 3 commits into
developfrom
feat/razorpay-services

Conversation

@harshtandiya

Copy link
Copy Markdown

What this changes

bwh_payments now selects in-memory stub gateways under tests (bwhtech/bwh_payments#13). This PR moves the commera tests onto those stubs:

  • test_razorpay_checkout.py is new. It covers the Razorpay journey: checkout, paid webhook, webhook replay, return-page confirmation, abandoned-cart release, paid-cart lock, pending sweep, and refund Payment Entry. It was written and passing against the old bwh_payments code first.
  • After the refactor, only the test's imports and its gateway driver helpers changed. Every test body is the same. This is the parity check for the bwh_payments refactor.
  • test_payment_hooks.py replaces FakeStripeClient with StubStripeClient, one for one. No assertion changes.

No application code changes.

Tests

79 unit and 687 integration tests pass, with 17 skipped.

Merge order

This needs bwhtech/bwh_payments#13. Merge that first, because this PR imports bwh_payments.services.*.stub.

Covers checkout link, paid webhook, replay, return-page confirm, abandoned
cart release, paid cart lock, pending sweep and refund Payment Entry.
Only the gateway driver helpers know the transport fake, so the bwh_payments
Razorpay refactor may change their bodies but never the tests.

Commits are suppressed for the class: the Razorpay controller logs every
call through create_request_log, which commits.
Only imports and the gateway driver helpers change; every test body is
untouched, which is the parity check for the bwh_payments refactor.
bwh_payments dropped tests/fake_stripe.py; the swap is one for one and no
assertion changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant