@@ -3,7 +3,7 @@ from io import BytesIO
3
3
from json import JSONEncoder
4
4
from re import Pattern
5
5
from types import TracebackType
6
- from typing import Any , Generic , NoReturn , TypeVar , overload
6
+ from typing import Any , Generic , NoReturn , TypeVar
7
7
8
8
from django .contrib .auth .base_user import AbstractBaseUser
9
9
from django .contrib .sessions .backends .base import SessionBase
@@ -16,7 +16,6 @@ from django.http.response import HttpResponseBase
16
16
from django .template .base import Template
17
17
from django .test .utils import ContextList
18
18
from django .urls import ResolverMatch
19
- from typing_extensions import Literal
20
19
21
20
BOUNDARY : str
22
21
MULTIPART_CONTENT : str
@@ -99,8 +98,6 @@ class _MonkeyPatchedWSGIResponse(_WSGIResponse):
99
98
context : ContextList | dict [str , Any ]
100
99
content : bytes
101
100
resolver_match : ResolverMatch
102
-
103
- class _MonkeyPatchedWSGIResponseRedirect (_MonkeyPatchedWSGIResponse ):
104
101
redirect_chain : list [tuple [str , int ]]
105
102
106
103
class _MonkeyPatchedASGIResponse (_ASGIResponse ):
@@ -131,136 +128,25 @@ class Client(ClientMixin, _RequestFactory[_MonkeyPatchedWSGIResponse]):
131
128
) -> None : ...
132
129
# Silence type warnings, since this class overrides arguments and return types in an unsafe manner.
133
130
def request (self , ** request : Any ) -> _MonkeyPatchedWSGIResponse : ...
134
- @overload # type: ignore
135
- def get (
136
- self , path : str , data : Any = ..., follow : Literal [False ] = ..., secure : bool = ..., ** extra : Any
137
- ) -> _MonkeyPatchedWSGIResponse : ...
138
- @overload
139
- def get (
140
- self , path : str , data : Any = ..., follow : Literal [True ] = ..., secure : bool = ..., ** extra : Any
141
- ) -> _MonkeyPatchedWSGIResponseRedirect : ...
142
- @overload
143
- def get (
131
+ def get ( # type: ignore
144
132
self , path : str , data : Any = ..., follow : bool = ..., secure : bool = ..., ** extra : Any
145
133
) -> _MonkeyPatchedWSGIResponse : ...
146
- @overload # type: ignore
147
- def post (
148
- self ,
149
- path : str ,
150
- data : Any = ...,
151
- content_type : str = ...,
152
- follow : Literal [False ] = ...,
153
- secure : bool = ...,
154
- ** extra : Any
155
- ) -> _MonkeyPatchedWSGIResponse : ...
156
- @overload
157
- def post (
158
- self ,
159
- path : str ,
160
- data : Any = ...,
161
- content_type : str = ...,
162
- follow : Literal [True ] = ...,
163
- secure : bool = ...,
164
- ** extra : Any
165
- ) -> _MonkeyPatchedWSGIResponseRedirect : ...
166
- @overload
167
- def post (
134
+ def post ( # type: ignore
168
135
self , path : str , data : Any = ..., content_type : str = ..., follow : bool = ..., secure : bool = ..., ** extra : Any
169
136
) -> _MonkeyPatchedWSGIResponse : ...
170
- @overload # type: ignore
171
- def head (
172
- self , path : str , data : Any = ..., follow : Literal [False ] = ..., secure : bool = ..., ** extra : Any
173
- ) -> _MonkeyPatchedWSGIResponse : ...
174
- @overload
175
- def head (
176
- self , path : str , data : Any = ..., follow : Literal [True ] = ..., secure : bool = ..., ** extra : Any
177
- ) -> _MonkeyPatchedWSGIResponseRedirect : ...
178
- @overload
179
- def head (
137
+ def head ( # type: ignore
180
138
self , path : str , data : Any = ..., follow : bool = ..., secure : bool = ..., ** extra : Any
181
139
) -> _MonkeyPatchedWSGIResponse : ...
182
- @overload # type: ignore
183
- def trace (
184
- self , path : str , data : Any = ..., follow : Literal [False ] = ..., secure : bool = ..., ** extra : Any
185
- ) -> _MonkeyPatchedWSGIResponse : ...
186
- @overload
187
- def trace (
188
- self , path : str , data : Any = ..., follow : Literal [True ] = ..., secure : bool = ..., ** extra : Any
189
- ) -> _MonkeyPatchedWSGIResponseRedirect : ...
190
- @overload
191
- def trace (
140
+ def trace ( # type: ignore
192
141
self , path : str , data : Any = ..., follow : bool = ..., secure : bool = ..., ** extra : Any
193
142
) -> _MonkeyPatchedWSGIResponse : ...
194
- @overload # type: ignore
195
- def put (
196
- self ,
197
- path : str ,
198
- data : Any = ...,
199
- content_type : str = ...,
200
- follow : Literal [False ] = ...,
201
- secure : bool = ...,
202
- ** extra : Any
203
- ) -> _MonkeyPatchedWSGIResponse : ...
204
- @overload
205
- def put (
206
- self ,
207
- path : str ,
208
- data : Any = ...,
209
- content_type : str = ...,
210
- follow : Literal [True ] = ...,
211
- secure : bool = ...,
212
- ** extra : Any
213
- ) -> _MonkeyPatchedWSGIResponseRedirect : ...
214
- @overload
215
- def put (
143
+ def put ( # type: ignore
216
144
self , path : str , data : Any = ..., content_type : str = ..., follow : bool = ..., secure : bool = ..., ** extra : Any
217
145
) -> _MonkeyPatchedWSGIResponse : ...
218
- @overload # type: ignore
219
- def patch (
220
- self ,
221
- path : str ,
222
- data : Any = ...,
223
- content_type : str = ...,
224
- follow : Literal [False ] = ...,
225
- secure : bool = ...,
226
- ** extra : Any
227
- ) -> _MonkeyPatchedWSGIResponse : ...
228
- @overload
229
- def patch (
230
- self ,
231
- path : str ,
232
- data : Any = ...,
233
- content_type : str = ...,
234
- follow : Literal [True ] = ...,
235
- secure : bool = ...,
236
- ** extra : Any
237
- ) -> _MonkeyPatchedWSGIResponseRedirect : ...
238
- @overload
239
- def patch (
146
+ def patch ( # type: ignore
240
147
self , path : str , data : Any = ..., content_type : str = ..., follow : bool = ..., secure : bool = ..., ** extra : Any
241
148
) -> _MonkeyPatchedWSGIResponse : ...
242
- @overload # type: ignore
243
- def delete (
244
- self ,
245
- path : str ,
246
- data : Any = ...,
247
- content_type : str = ...,
248
- follow : Literal [False ] = ...,
249
- secure : bool = ...,
250
- ** extra : Any
251
- ) -> _MonkeyPatchedWSGIResponse : ...
252
- @overload
253
- def delete (
254
- self ,
255
- path : str ,
256
- data : Any = ...,
257
- content_type : str = ...,
258
- follow : Literal [True ] = ...,
259
- secure : bool = ...,
260
- ** extra : Any
261
- ) -> _MonkeyPatchedWSGIResponseRedirect : ...
262
- @overload
263
- def delete (
149
+ def delete ( # type: ignore
264
150
self , path : str , data : Any = ..., content_type : str = ..., follow : bool = ..., secure : bool = ..., ** extra : Any
265
151
) -> _MonkeyPatchedWSGIResponse : ...
266
152
0 commit comments