reviewboard.scmtools.testing.queries¶
Testing utilities for building expected queries for repositories.
New in version 5.0.7.
- get_repositories_accessible_equeries(*, user: Union[AnonymousUser, User], local_site: AnyOrAllLocalSites = None, visible_only: bool = True, distinct: bool = True) ExpectedQueries [source]¶
Return expected queries for Repository.objects.accessible().
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.visible_only (
bool
, optional) – Whether the queries are for visible repositories only.distinct (
bool
, optional) – Whether to expect a distinct query.
- Returns:
The list of expected queries.
- Return type:
- get_repositories_accessible_ids_equeries(*, user: Union[AnonymousUser, User], local_site: AnyOrAllLocalSites = None, visible_only: bool = True) ExpectedQueries [source]¶
Return expected queries for Repository.objects.accessible_ids().
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.visible_only (
bool
, optional) – Whether the queries are for visible repositories only.
- Returns:
The list of expected queries.
- Return type: