Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test client response.redirect_chain #1124

Merged
merged 1 commit into from
Aug 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions django-stubs/test/client.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ class _MonkeyPatchedWSGIResponse(_WSGIResponse):
context: List[Dict[str, Any]]
content: bytes
resolver_match: ResolverMatch
redirect_chain: List[Tuple[str, int]]

class _MonkeyPatchedASGIResponse(_ASGIResponse):
def json(self) -> Any: ...
Expand All @@ -137,6 +138,7 @@ class _MonkeyPatchedASGIResponse(_ASGIResponse):
context: List[Dict[str, Any]]
content: bytes
resolver_match: ResolverMatch
redirect_chain: List[Tuple[str, int]]

class ClientMixin:
def store_exc_info(self, **kwargs: Any) -> None: ...
Expand Down
2 changes: 2 additions & 0 deletions tests/typecheck/test/test_client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
reveal_type(response.client) # N: Revealed type is "django.test.client.Client"
reveal_type(response.context) # N: Revealed type is "builtins.list[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: |
Expand All @@ -22,6 +23,7 @@
reveal_type(response.client) # N: Revealed type is "django.test.client.AsyncClient"
reveal_type(response.context) # N: Revealed type is "builtins.list[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: |
Expand Down