reviewboard.site.testing.queries¶
Testing utilities for building expected queries for Local Sites.
New in version 5.0.7.
- get_local_site_by_name_equeries(*, local_site: LocalSite) List[Union[ExpectedQuery, Dict[str, Any]]] [source]¶
Return expected queries for accessing a Local Site by name.
New in version 5.0.7.
- Parameters:
local_site (
reviewboard.site.models.LocalSite
) – The Local Site being accessed.- Returns:
The list of expected queries.
- Return type:
- get_local_site_is_accessible_by_equeries(*, user: Union[AnonymousUser, User], local_site: LocalSite) ExpectedQueries [source]¶
Return expected queries for Local Site accessibility checks.
This corresponds to a call to
LocalSite.is_accessible_by()
.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
) – The Local Site being accessed.
- Returns:
The list of expected queries.
- Return type:
- get_local_site_is_mutable_by_equeries(*, user: User, local_site: LocalSite, note: Optional[str] = None) List[Union[ExpectedQuery, Dict[str, Any]]] [source]¶
Return expected queries for Local Site mutability checks.
This corresponds to a call to
LocalSite.is_mutable_by()
.New in version 5.0.7.
- Parameters:
user (
django.contrib.auth.models.User
) – The user that’s checked for access.local_site (
reviewboard.site.models.LocalSite
) – The Local Site being accessed.note (
str
, optional) – An optional note to use, instead of the default.
- Returns:
The list of expected queries.
- Return type:
- get_check_local_site_access_equeries(*, user: Union[AnonymousUser, User], local_site: LocalSite) ExpectedQueries [source]¶
Return expected queries for the @check_local_site_access decorator.
This corresponds to a call to
check_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
) – The Local Site being accessed.
- Returns:
The list of expected queries.
- Return type: