Repository navigation
test(bookings): build booking fixtures with factories and split by behaviour - #543
Merged
harshtandiya merged 6 commits intoOct 6, 2026
Merged
Conversation
Lane-owned factories for the booking refund tests. EventPayment's received trait gives each payment a unique gateway id, since refund webhooks look the payment up by it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SWM6kF7ncqfQx9eYpBKcbm
test_event_booking.py splits into totals, offline, emails and confirmation files; it keeps ticket availability, process_booking and the Zoom last-name tests. test_event_booking_refund.py keeps refund requests and the refund ceiling; webhook and sync tests move to test_refund_sync.py. Both share BookingRefundTestCase in refund_test_case.py. Every class builds its own event instead of reading test-route. Drops the UTM child-table persistence tests, tax_exclusive_still_works and tax_inclusive_with_single_ticket, which repeat total_calculation_with_taxes and tax_inclusive_calculation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SWM6kF7ncqfQx9eYpBKcbm
Contributor
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
…to refactor/test-to-factories-2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SWM6kF7ncqfQx9eYpBKcbm
Contributor
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
…to refactor/test-to-factories-2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SWM6kF7ncqfQx9eYpBKcbm
Contributor
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
This is lane 1 of the test refactor. It is stacked on #540.
EventPaymentFactory, with areceivedtrait that gives each payment its own payment id, andIntegrationRequestFactory.test_event_booking.py:test_booking_totals,test_offline_booking,test_booking_emailsandtest_booking_confirmation.test_event_booking.pyitself keeps availability, UTM and the Zoom last-name tests.test_event_booking_refund.py.test_refund_sync.py.refund_test_case.py.test_guest_bookingandtest_event_eligibilitynow use factories.test-routeor uses a date literal any more.Tests: 118 → 111.
tax_exclusive_still_works).tax_inclusive_with_single_ticket, because it is a duplicate oftax_inclusive_calculation.api/booking, so I kept all of them.Kept for other importers:
make_payment_gatewaystays intest_event_booking_refund.py. Its body now usesPaymentGatewayFactory. The cleanup PR deletes it.Candidates for the cleanup PR:
offline_awaiting_verificationbooking trait.Event Check InandAttendee Ticket Add-on. This lane uses the production helpers for now.BookingRefundTestCaseintobuzz/tests/base_test_cases.py.Demo
Not applicable. This PR changes only tests (
skip-demo).Testing
ruff0.8.1 format and check pass, and every changed file compiles.🤖 Generated with Claude Code
https://claude.ai/code/session_01SWM6kF7ncqfQx9eYpBKcbm
Generated by Claude Code