def test_validate_bearer_token_should_get_cache_expiration_from_token(
self,
access_token,
validator,
scopes,
http_request
):
expires = timezone.now() - timedelta(seconds=5)
access_token.expires = expires
access_token.save()
self._warm_up_cache(
validator,
access_token.token,
scopes,
http_request
)
with CaptureQueriesContext(connection) as context:
validator.validate_bearer_token(
access_token.token,
scopes,
http_request
)
assert len(context.captured_queries) == 1
评论列表
文章目录