From 1a310ef7f916247c10396d8d4c2c4d6e1df3649d Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Fri, 26 Aug 2022 11:31:17 +0100 Subject: [PATCH] Add test client response.redirect_chain (#1124) --- django-stubs/test/client.pyi | 2 ++ tests/typecheck/test/test_client.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/django-stubs/test/client.pyi b/django-stubs/test/client.pyi index 3db9b5010..4d11de6af 100644 --- a/django-stubs/test/client.pyi +++ b/django-stubs/test/client.pyi @@ -129,6 +129,7 @@ class _MonkeyPatchedWSGIResponse(_WSGIResponse): context: ContextList | Dict[str, Any] content: bytes resolver_match: ResolverMatch + redirect_chain: List[Tuple[str, int]] class _MonkeyPatchedASGIResponse(_ASGIResponse): def json(self) -> Any: ... @@ -138,6 +139,7 @@ class _MonkeyPatchedASGIResponse(_ASGIResponse): context: ContextList | Dict[str, Any] content: bytes resolver_match: ResolverMatch + redirect_chain: List[Tuple[str, int]] class ClientMixin: def store_exc_info(self, **kwargs: Any) -> None: ... diff --git a/tests/typecheck/test/test_client.yml b/tests/typecheck/test/test_client.yml index 658eba8c2..56c17d33a 100644 --- a/tests/typecheck/test/test_client.yml +++ b/tests/typecheck/test/test_client.yml @@ -9,6 +9,7 @@ reveal_type(response.client) # N: Revealed type is "django.test.client.Client" reveal_type(response.context) # N: Revealed type is "Union[django.test.utils.ContextList, builtins.dict[builtins.str, Any]]" reveal_type(response.content) # N: Revealed type is "builtins.bytes" + reveal_type(response.redirect_chain) # N: Revealed type is "builtins.list[Tuple[builtins.str, builtins.int]]" response.json() - case: async_client_methods main: | @@ -22,6 +23,7 @@ reveal_type(response.client) # N: Revealed type is "django.test.client.AsyncClient" reveal_type(response.context) # N: Revealed type is "Union[django.test.utils.ContextList, builtins.dict[builtins.str, Any]]" reveal_type(response.content) # N: Revealed type is "builtins.bytes" + reveal_type(response.redirect_chain) # N: Revealed type is "builtins.list[Tuple[builtins.str, builtins.int]]" response.json() - case: request_factories main: |