reviewboard.testing.queries.http¶
Testing utilities for building HTTP-related expected queries.
New in version 5.0.7.
- get_http_request_user_equeries(*, user: User) List[Union[ExpectedQuery, Dict[str, Any]]] [source]¶
Return expected queries for fetching the user from the HTTP request.
This corresponds to a call to
HttpRequest.user
.New in version 5.0.7.
- Parameters:
user (
django.contrib.auth.models.User
) – The user that’s expected to be fetched.- Returns:
The list of expected queries.
- Return type:
- get_http_request_start_equeries(*, user: Union[AnonymousUser, User], local_site: Optional[LocalSite] = None, checks_local_site_access: bool = True) ExpectedQueries [source]¶
Return expected queries for the start of an HTTP request.
This covers queries that fetch the user, their profile, and optionally the check for Local Site access.
New in version 5.0.7.
- Parameters:
user (
django.contrib.auth.models.AnonymousUser
or :class:`` :class:`` :class:`` :class:`` :class:`` :class:`` :class:`` :class:`` :class:`` :class:``django.contrib.auth.models.User
) – The user that’s checked for access.local_site (
reviewboard.site.models.LocalSite
, optional) – The optional Local Site value used in the queries.checks_local_site_access (
bool
, optional) – Whether the requested view uses thecheck_local_site_access()
decorator.
- Returns:
The list of expected queries.
- Return type: