test(search/alerts/feeds): replace fixtures with factories#6863
Open
johnjhughes wants to merge 4 commits intofreelawproject:mainfrom
Open
test(search/alerts/feeds): replace fixtures with factories#6863johnjhughes wants to merge 4 commits intofreelawproject:mainfrom
johnjhughes wants to merge 4 commits intofreelawproject:mainfrom
Conversation
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Pull request overview
This PR continues the ongoing migration away from Django JSON fixtures by updating several test modules (including Selenium functional tests) to build test data using factories, improving clarity and reducing reliance on shared fixture state.
Changes:
- Replaced
fixtures = [...]usage with explicit factory-built test data setup in multiple test modules. - Improved Selenium test robustness with additional explicit waits and small flake-mitigation fallbacks.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
cl/tests/test_issue412.py |
Replaces opinion/docket/audio blocking fixtures with factory-created courts, clusters, opinions, and audio used by Selenium tests. |
cl/tests/test_feeds.py |
Replaces feed functional test fixtures with factory-created opinions and audio content needed for feed assertions. |
cl/search/tests/tests.py |
Replaces search test fixtures with factories and adds Selenium timing improvements (waits, element targeting, modal/dropdown fallbacks). |
cl/alerts/tests/tests.py |
Replaces court fixture usage in alert tests with factory-created courts; adjusts Selenium test setup ordering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Replace search/alerts fixtures with factories
Summary
This PR migrates a small set of tests away from Django JSON fixtures and onto factories, as part of the broader fixture cleanup tracked in #2148.
Details
cl/search/tests/tests.pycl/alerts/tests/tests.pycl/tests/test_feeds.pycl/tests/test_issue412.pyRelated to: #2148
Tests
uv run python manage.py test --parallel 1 cl.search.tests.tests.ModelTest cl.search.tests.tests.OpinionSearchFunctionalTest cl.alerts.tests.tests.DisableDocketAlertTest cl.alerts.tests.tests.AlertSeleniumTest cl.tests.test_feeds cl.tests.test_issue412Notes
def test_counts are unchanged in each migrated module.