1+ from collections .abc import Iterable , Mapping
12from typing import Any
3+ from typing_extensions import TypeAlias
24
35import coreapi
46import requests
@@ -14,6 +16,12 @@ from rest_framework.authtoken.models import Token
1416from rest_framework .request import Request
1517from rest_framework .response import _MonkeyPatchedResponse
1618
19+ _GetDataType : TypeAlias = (
20+ Mapping [str , str | bytes | int | Iterable [str | bytes | int ]]
21+ | Iterable [tuple [str , str | bytes | int | Iterable [str | bytes | int ]]]
22+ | None
23+ )
24+
1725def force_authenticate (
1826 request : HttpRequest , user : AnonymousUser | AbstractBaseUser | None = ..., token : Token | None = ...
1927) -> None : ...
@@ -50,7 +58,7 @@ class APIRequestFactory(DjangoRequestFactory):
5058 renderer_classes : Any
5159 def __init__ (self , enforce_csrf_checks : bool = ..., ** defaults : Any ) -> None : ...
5260 def request (self , ** kwargs : Any ) -> Request : ... # type: ignore[override]
53- def get (self , path : str , data : dict [ str , Any ] | str | None = ..., follow : bool = ..., ** extra : Any ): ... # type: ignore[override]
61+ def get (self , path : str , data : _GetDataType = ..., follow : bool = ..., ** extra : Any ): ... # type: ignore[override]
5462 def post (self , path : str , data : Any | None = ..., format : str | None = ..., content_type : str | None = ..., follow : bool = ..., ** extra : Any ) -> Request : ... # type: ignore[override]
5563 def put (self , path : str , data : Any | None = ..., format : str | None = ..., content_type : str | None = ..., follow : bool = ..., ** extra : Any ) -> Request : ... # type: ignore[override]
5664 def patch (self , path : str , data : Any | None = ..., format : str | None = ..., content_type : str | None = ..., follow : bool = ..., ** extra : Any ) -> Request : ... # type: ignore[override]
@@ -68,7 +76,7 @@ class APIClient(APIRequestFactory, DjangoClient):
6876 def credentials (self , ** kwargs : Any ): ...
6977 def force_authenticate (self , user : AnonymousUser | AbstractBaseUser = ..., token : Token | None = ...) -> None : ...
7078 def request (self , ** kwargs : Any ) -> _MonkeyPatchedResponse : ... # type: ignore[override]
71- def get (self , path : str , data : dict [ str , Any ] | str | None = ..., follow : bool = ..., ** extra : Any ): ... # type: ignore[override]
79+ def get (self , path : str , data : _GetDataType = ..., follow : bool = ..., ** extra : Any ): ... # type: ignore[override]
7280 def post (self , path : str , data : Any | None = ..., format : str | None = ..., content_type : str | None = ..., follow : bool = ..., ** extra : Any ) -> _MonkeyPatchedResponse : ... # type: ignore[override]
7381 def put (self , path : str , data : Any | None = ..., format : str | None = ..., content_type : str | None = ..., follow : bool = ..., ** extra : Any ) -> _MonkeyPatchedResponse : ... # type: ignore[override]
7482 def patch (self , path : str , data : Any | None = ..., format : str | None = ..., content_type : str | None = ..., follow : bool = ..., ** extra : Any ) -> _MonkeyPatchedResponse : ... # type: ignore[override]
0 commit comments