Add test client response.redirect_chain (#1124)

This commit is contained in:
Adam Johnson
2022-08-26 11:31:17 +01:00
committed by GitHub
parent 8b5509b2ab
commit 1a310ef7f9
2 changed files with 4 additions and 0 deletions

View File

@@ -129,6 +129,7 @@ class _MonkeyPatchedWSGIResponse(_WSGIResponse):
context: ContextList | Dict[str, Any] context: ContextList | Dict[str, Any]
content: bytes content: bytes
resolver_match: ResolverMatch resolver_match: ResolverMatch
redirect_chain: List[Tuple[str, int]]
class _MonkeyPatchedASGIResponse(_ASGIResponse): class _MonkeyPatchedASGIResponse(_ASGIResponse):
def json(self) -> Any: ... def json(self) -> Any: ...
@@ -138,6 +139,7 @@ class _MonkeyPatchedASGIResponse(_ASGIResponse):
context: ContextList | Dict[str, Any] context: ContextList | Dict[str, Any]
content: bytes content: bytes
resolver_match: ResolverMatch resolver_match: ResolverMatch
redirect_chain: List[Tuple[str, int]]
class ClientMixin: class ClientMixin:
def store_exc_info(self, **kwargs: Any) -> None: ... def store_exc_info(self, **kwargs: Any) -> None: ...

View File

@@ -9,6 +9,7 @@
reveal_type(response.client) # N: Revealed type is "django.test.client.Client" 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.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.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() response.json()
- case: async_client_methods - case: async_client_methods
main: | main: |
@@ -22,6 +23,7 @@
reveal_type(response.client) # N: Revealed type is "django.test.client.AsyncClient" 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.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.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() response.json()
- case: request_factories - case: request_factories
main: | main: |