Skip to content

Commit f2f5a24

Browse files
Revert "fix: Add context_data attribute to _MonkeyPatchedW/ASGIResponse. (typeddjango#2509)" (#34)
This reverts commit 630144f.
1 parent d5b731b commit f2f5a24

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

django-stubs/test/client.pyi

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -216,15 +216,7 @@ class _MonkeyPatchedWSGIResponse(_WSGIResponse):
216216
request: dict[str, Any]
217217
client: Client
218218
templates: list[Template]
219-
220-
# `context` and `context_data` are populated based on whether you use the standard template
221-
# backend or a custom one respectively.
222-
# `context_data` only exists if the response was successful too as the return type changes.
223-
# `HTTPResponse` when API failed and `TemplateResponse` when successful.
224-
# https://docs.djangoproject.com/en/stable/topics/testing/tools/#django.test.Response.context
225219
context: ContextList | dict[str, Any]
226-
context_data: ContextList | dict[str, Any]
227-
228220
content: bytes
229221
resolver_match: ResolverMatch
230222
redirect_chain: list[tuple[str, int]]
@@ -237,15 +229,7 @@ class _MonkeyPatchedASGIResponse(_ASGIResponse):
237229
request: dict[str, Any]
238230
client: AsyncClient
239231
templates: list[Template]
240-
241-
# `context` and `context_data` are populated based on whether you use the standard template
242-
# backend or a custom one respectively.
243-
# `context_data` only exists if the response was successful too as the return type changes.
244-
# `HTTPResponse` when API failed and `TemplateResponse` when successful.
245-
# https://docs.djangoproject.com/en/stable/topics/testing/tools/#django.test.Response.context
246232
context: ContextList | dict[str, Any]
247-
context_data: ContextList | dict[str, Any]
248-
249233
content: bytes
250234
resolver_match: ResolverMatch
251235
redirect_chain: list[tuple[str, int]]

tests/typecheck/test/test_client.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
reveal_type(response.templates) # N: Revealed type is "builtins.list[django.template.base.Template]"
99
reveal_type(response.client) # N: Revealed type is "django.test.client.Client"
1010
reveal_type(response.context) # N: Revealed type is "Union[django.test.utils.ContextList, builtins.dict[builtins.str, Any]]"
11-
reveal_type(response.context_data) # N: Revealed type is "Union[django.test.utils.ContextList, builtins.dict[builtins.str, Any]]"
1211
reveal_type(response.content) # N: Revealed type is "builtins.bytes"
1312
reveal_type(response.redirect_chain) # N: Revealed type is "builtins.list[Tuple[builtins.str, builtins.int]]"
1413
reveal_type(response.text) # N: Revealed type is "builtins.str"
@@ -24,7 +23,6 @@
2423
reveal_type(response.templates) # N: Revealed type is "builtins.list[django.template.base.Template]"
2524
reveal_type(response.client) # N: Revealed type is "django.test.client.AsyncClient"
2625
reveal_type(response.context) # N: Revealed type is "Union[django.test.utils.ContextList, builtins.dict[builtins.str, Any]]"
27-
reveal_type(response.context_data) # N: Revealed type is "Union[django.test.utils.ContextList, builtins.dict[builtins.str, Any]]"
2826
reveal_type(response.content) # N: Revealed type is "builtins.bytes"
2927
reveal_type(response.redirect_chain) # N: Revealed type is "builtins.list[Tuple[builtins.str, builtins.int]]"
3028
response.json()

0 commit comments

Comments
 (0)