Add expected queries and enhance tests for Repository access queries.
Review Request #13409 — Created Nov. 8, 2023 and submitted
This adds pre-built expected queries for:
Repository.objects.accessible()
Repository.objects.accessible_ids()
These functions live in reviewboard.scmtools.testing.queries
, and can
be reused throughout our test suite. It's written in a verbose manner
that ensures we only ever test against finalized Q expressions, to
minimize chances of regressions or unexpected behavior.
The unit tests for .accessible()
and .accessible_ids()
have been
completely rewritten. They now check against these expected queries, but
they've also been expanded considerably to more thoroughly check access
with positive and negative test data, to better catch regressions. The
approach being used here will be carried over to other accessibility
tests for the next batch of this peformance work.
Unit tests pass.
Summary | ID |
---|---|
c9d92274c8bd4324b397be9aaacca4ba12864433 |
Description | From | Last Updated |
---|---|---|
'typing.Optional' imported but unused Column: 1 Error code: F401 |
reviewbot | |
'django.contrib.auth.models.Permission' imported but unused Column: 1 Error code: F401 |
reviewbot | |
'reviewboard.accounts.models.LocalSiteProfile' imported but unused Column: 1 Error code: F401 |
reviewbot | |
'reviewboard.accounts.models.Profile' imported but unused Column: 1 Error code: F401 |
reviewbot | |
'reviewboard.reviews.models.Group' imported but unused Column: 1 Error code: F401 |
reviewbot |
- Change Summary:
-
Removed unused imports.
- Commits:
-
Summary ID d54843e8fc86bc0f02b56cbb6bfcd8d194ba8da8 9f6633a53ca2bd96e587880e8b15b26d80ddb5ce