flake8
-
reviewboard/reviews/testing/queries.py (Diff revision 1) Show all issues
Review Request #13406 — Created Nov. 7, 2023 and updated
This introduces the
reviewboard.reviews.testing.queries.review_groups
module for query-building functions for tests. It contains the following
methods:
get_review_groups_accessible_q()
get_review_groups_accessible_prep_equeries()
get_review_groups_accessible_equeries()
get_review_groups_accessible_ids_equeries()
These generate expected Q
objects and queries that matches calls to
Group.objects.accessible()
and Group.objects.accessible_ids()
.
They're 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 |
---|---|
19eaaa95f857a5be74f08b83d1545a27c1980289 |
Description | From | Last Updated |
---|---|---|
Hold off on reviewing this. I'm going to make some changes and combine with the .accessible() change. |
|
|
undefined name 'get_local_site_profile_equeries' Column: 29 Error code: F821 |
![]() |
|
'django.contrib.auth.models.Permission' imported but unused Column: 1 Error code: F401 |
![]() |
Removed some dead code.
Commits: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+1774 -264) |
Rewrote unit tests based on the new repository tests, which test for positive and negative results in user/access-focused tests.
Summary: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Commits: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 3 (+2270 -644) |
reviewboard/reviews/tests/test_review_group_manager.py (Diff revision 3) |
---|
'django.contrib.auth.models.Permission' imported but unused Column: 1 Error code: F401
Removed an unused import.
Commits: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Diff: |
Revision 4 (+2270 -644) |
reviewboard.reviews.testing.queries.review_groups
, since the file would otherwise grow considerably.Q
-building into a standalone function, for use in upcoming datagrid test updates.Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commits: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 5 (+2522 -644) |
Added an option for avoiding permission lookups if already cached.
Commits: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Diff: |
Revision 6 (+2558 -644) |