reviewboard.accounts.testing.queries¶
Testing utilities for building expected queries for accounts.
New in version 5.0.7.
- get_user_by_pk_equeries(*, user: User, note: Optional[str] = None) List[Union[ExpectedQuery, Dict[str, Any]]] [source]¶
Return expected queries for fetching a user by ID.
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 expected to be fetched.note (
str
, optional) – An optional note to use, instead of the default.
- Returns:
The list of expected queries.
- Return type:
- get_user_local_site_profile_equeries(*, user: User, profile: Profile, local_site: Optional[LocalSite] = None) ExpectedQueries [source]¶
Return expected queries for accessing a user’s LocalSiteProfile.
This corresponds to a call to
User.get_site_profile()
.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 with the profile.profile (
reviewboard.accounts.models.Profile
) – The user’s primary profile.local_site (
reviewboard.site.models.LocalSite
, optional) – The optional Local Site associated with the profile.
- Returns:
The list of expected queries.
- Return type:
- get_user_permissions_equeries(*, user: User) List[Union[ExpectedQuery, Dict[str, Any]]] [source]¶
Return expected queries for fetching a user’s permissions.
This corresponds to a call to
StandardAuthBackend.has_perm()
, without passing a Local Site.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 with the profile.- Returns:
The list of expected queries.
- Return type:
- get_user_profile_equeries(*, user: User) List[Union[ExpectedQuery, Dict[str, Any]]] [source]¶
Return expected queries for accessing a user’s profile.
This corresponds to a call to
User.get_profile()
.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 with the profile.- Returns:
The list of expected queries.
- Return type: