Add expected query utilities for common tests, accounts and Local Sites.
Review Request #13411 — Created Nov. 9, 2023 and submitted
This introduces some new utility functions for generating common
expected queries:
-
reviewboard.accounts.testing.queries
:get_user_by_pk_equeries()
get_user_local_site_profile_equeries()
get_user_profile_equeries()
-
reviewboard.site.testing.queries
:get_local_site_by_name_equeries()
get_local_site_is_accessible_by_equeries()
get_local_site_is_mutable_by_equeries()
get_check_local_site_access_equeries()
-
reviewboard.testing.queries.http
:get_http_request_user_equeries()
get_http_request_start_equeries()
Most of these perform simple checks used at the start of most view
handling. They'll be used for some in-progress test updates, and will
likely be expanded as the equery library grows.
It also introduces a common type for functions that return
Q-expressions: reviewboard.testing.queries.base.ExpectedQResult
. This
helps ensure consistent results and typing for these sorts of functions.
In-progress unit tests pass.
Summary | ID |
---|---|
61b9fea1e81def2ea936758495ece621d0bb61e4 |
- Change Summary:
-
- Made
reviewboard.testing.queries
a parent module. - Moved the HTTP equery helpers into a
.http
sub-module. - Added a helpful
ExpectedQResult
type.
- Made
- Summary:
-
Add expected query utilities for accounts and Local Sites.Add expected query utilities for common tests, accounts and Local Sites.
- Description:
-
This introduces some new utility functions for generating common
expected queries: -
reviewboard.accounts.testing.queries
:get_user_by_pk_equeries()
get_user_local_site_profile_equeries()
get_user_profile_equeries()
-
reviewboard.site.testing.queries
:get_local_site_by_name_equeries()
get_local_site_is_accessible_by_equeries()
get_local_site_is_mutable_by_equeries()
get_check_local_site_access_equeries()
~ -
reviewboard.testing.queries
:get_http_request_user_equeries()
get_http_request_start_equeries()
~ -
reviewboard.testing.queries.http
:get_http_request_user_equeries()
get_http_request_start_equeries()
Most of these perform simple checks used at the start of most view
handling. They'll be used for some in-progress test updates, and will likely be expanded as the equery library grows. + + It also introduces a common type for functions that return
+ Q-expressions: reviewboard.testing.queries.base.ExpectedQResult
. This+ helps ensure consistent results and typing for these sorts of functions. -
- Commits:
-
Summary ID 0b5dbc21b39cc3c5a9b60041bb828129aeb0fa7a 2c871643e16d716fee8fd10d59c6656895d9aefa - Diff:
-
Revision 2 (+868 -6)
Checks run (2 succeeded)
- Change Summary:
-
- Fixed up
get_local_site_is_accessible_by_equeries()
andget_local_site_is_mutable_by_equeries()
to return the right results for anonymous users.
- Fixed up
- Commits:
-
Summary ID 2c871643e16d716fee8fd10d59c6656895d9aefa 612531ef5833125d19442fdff5e11cb43833d08b - Diff:
-
Revision 3 (+868 -6)
Checks run (2 succeeded)
- Change Summary:
-
- Fixed some doc typos.
- Added missing
note
docs.
- Commits:
-
Summary ID 612531ef5833125d19442fdff5e11cb43833d08b 61b9fea1e81def2ea936758495ece621d0bb61e4 - Diff:
-
Revision 4 (+886 -6)