Skip to content

test(search/alerts/feeds): replace fixtures with factories#6863

Open
johnjhughes wants to merge 4 commits intofreelawproject:mainfrom
johnjhughes:2148-search-alerts-tests-20260204
Open

test(search/alerts/feeds): replace fixtures with factories#6863
johnjhughes wants to merge 4 commits intofreelawproject:mainfrom
johnjhughes:2148-search-alerts-tests-20260204

Conversation

@johnjhughes
Copy link
Copy Markdown
Contributor

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

  • Replace fixture usage with factories in:
    • cl/search/tests/tests.py
    • cl/alerts/tests/tests.py
    • cl/tests/test_feeds.py
    • cl/tests/test_issue412.py
  • Keep existing fixture files in place (they are still referenced by other modules outside this PR’s scope).

Related 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_issue412

Notes

  • No tests removed: def test_ counts are unchanged in each migrated module.

@johnjhughes johnjhughes marked this pull request as ready for review February 12, 2026 00:15
Copilot AI review requested due to automatic review settings February 12, 2026 00:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

2 participants