Repository navigation
test(api): build account, forms, comms and misc API fixtures with factories - #544
Merged
harshtandiya merged 11 commits intoOct 6, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SWM6kF7ncqfQx9eYpBKcbm
…igns and errors Move the BuzzAPIError tests to UnitTestCase and the login banner to change_settings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SWM6kF7ncqfQx9eYpBKcbm
Map link parsers move to UnitTestCase. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SWM6kF7ncqfQx9eYpBKcbm
Custom form tests move to test_custom_forms, event proposal form tests to test_event_proposal_form. Drop the status-code tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SWM6kF7ncqfQx9eYpBKcbm
Drop the details shape and plain-boolean tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SWM6kF7ncqfQx9eYpBKcbm
…ptures Entry and count bucket tests move to UnitTestCase. 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.
The maps outsider was created after setUp switched to the team owner, who cannot create Users. Build it in setUpClass instead. The communications list reads User.full_name from the database, while get_fullname caches per process and kept a name from an earlier class's rolled-back user. Pin the sender's name and assert it. 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-8
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-8
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 7 of the test refactor. It is stacked on #540.
Files converted to factories. These files now build their fixtures with factories:
api/account,api/auth,api/campaigns,api/test_exceptions,api/forms,api/communications,api/maps,api/ticketstest_telemetrytest_uninstallis unchanged. It was already clean.New factories:
BuzzCampaignFactoryTicketCancellationRequestFactory(traitaccepted)EventBookingRefundFactoryNew support module:
buzz/tests/telemetry_capture.py, with the telemetry capture helpers.Settings: Buzz Settings changes now go through
self.change_settings.Moved to
UnitTestCase:test_exceptionsentry_*/count_buckethelpersTestParseExcludedFieldsSplit files. Every file is now under 300 lines:
api/forms/test_forms.pytest_custom_forms.py,test_event_proposal_form.pyapi/tickets/test_tickets.pytest_ticket_windows.pytest_telemetry.pytest_telemetry_events.pyTests: 175 → 160.
status_codes, shape and keys tests, andsettings_flags_stay_integers.unknown_language_maps_to_400andunknown_timezone_maps_to_400.Kept for other importers:
ensure_prompt_named_recordandensure_event_hoststay inapi/forms/test_forms.py. 9 modules still import them. The cleanup PR deletes them.Candidates for the cleanup PR:
telemetry_capturehelpers intobuzz/tests/utils.py.custom_formtrait toBuzzCustomFieldFactory.test_ticket_windows.Demo
Not applicable. This PR changes only tests (
skip-demo).Testing
ruff0.8.1 format and check pass.py_compilepasses on every changed file.get_doc({,new_doc(, date literals,test-routeor cross-test imports remain, apart from the two kept helpers.🤖 Generated with Claude Code
https://claude.ai/code/session_01SWM6kF7ncqfQx9eYpBKcbm
Generated by Claude Code