Skip to content

CDD-3440: Add regression coverage for /api/pages/ filtering and search#3267

Open
dw-ukhsa wants to merge 4 commits into
mainfrom
task/CDD-3440-regression-tests-for-getpages
Open

CDD-3440: Add regression coverage for /api/pages/ filtering and search#3267
dw-ukhsa wants to merge 4 commits into
mainfrom
task/CDD-3440-regression-tests-for-getpages

Conversation

@dw-ukhsa

Copy link
Copy Markdown

Description

This PR includes the following:

  • Add API-level integration coverage for GET /api/pages/ filtering and search behaviour
  • Covers unauthenticated search requests when AUTH_ENABLED=True, ensuring private pages matching the search term are excluded
  • Covers AUTH_ENABLED=False, ensuring /api/pages returns the unfiltered public-prod result
  • Covers authenticated restricted-user search requests, ensuring results include public and permitted private pages only.
  • Refactors the unauthenticated AUTH_ENABLED=True filtering path to return a Wagtail-search-compatible id__in queryset

Fixes #CDD-3440


Type of change

Please select the options that are relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Tech debt item (this is focused solely on addressing any relevant technical debt)

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests at the right levels to prove my change is effective
  • I have added screenshots or screen grabs where appropriate
  • I have added docstrings in the correct style (google)

Testing:

python -m pytest tests/integration/cms/dashboard/test_viewsets.py

@dw-ukhsa dw-ukhsa requested a review from a team as a code owner June 30, 2026 08:04

@mattjreynolds mattjreynolds left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good 😎
It needs a rebase onto latest main, and it's failing the linting CI check, you can fix this by just running the linting fix in the uhd scripts:
source uhd.sh
uhd quality format

Nice work on cleaning up the tech debt in the queryset filtering in cms/dashboard/viewsets.py too, that's much more readable now 🙌
I've double checked that the integration tests pass even without those improvements, but given that we are changing the code as well as the tests we should run this through QA just to get sign off from Shahrukh that we don't have any regressions @sahmed06

@dw-ukhsa dw-ukhsa force-pushed the task/CDD-3440-regression-tests-for-getpages branch from 36ff66f to b627c48 Compare July 1, 2026 09:51
@dw-ukhsa

dw-ukhsa commented Jul 1, 2026

Copy link
Copy Markdown
Author

@mattjreynolds
Thanks for the heads up on the linting with uhd - didn't know it was a thing until now.
Linting should be fixed and rebased to current main 🦈

@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

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.

3 participants