1- from typing import Any , Dict , Optional , Type , Union
1+ from typing import Any , Dict , List , Optional , Tuple , Type , Union
22
33import coreapi
44import requests
@@ -14,6 +14,8 @@ from rest_framework.authtoken.models import Token
1414from rest_framework .request import Request
1515from rest_framework .response import Response
1616
17+ _GetDataType = Optional [Union [Dict [str , Any ], str , List [Tuple [str , str ]]]]
18+
1719def force_authenticate (
1820 request : HttpRequest , user : Optional [Union [AnonymousUser , AbstractBaseUser ]] = ..., token : Optional [Token ] = ...
1921) -> None : ...
@@ -50,7 +52,7 @@ class APIRequestFactory(DjangoRequestFactory):
5052 renderer_classes : Any = ...
5153 def __init__ (self , enforce_csrf_checks : bool = ..., ** defaults : Any ) -> None : ...
5254 def request (self , ** kwargs : Any ) -> Request : ... # type: ignore[override]
53- def get (self , path : str , data : Optional [ Union [ Dict [ str , Any ], str ]] = ..., follow : bool = ..., ** extra : Any ): ... # type: ignore[override]
55+ def get (self , path : str , data : _GetDataType = ..., follow : bool = ..., ** extra : Any ): ... # type: ignore[override]
5456 def post (self , path : str , data : Optional [Any ] = ..., format : Optional [str ] = ..., content_type : Optional [str ] = ..., follow : bool = ..., ** extra : Any ) -> Request : ... # type: ignore[override]
5557 def put (self , path : str , data : Optional [Any ] = ..., format : Optional [str ] = ..., content_type : Optional [str ] = ..., follow : bool = ..., ** extra : Any ) -> Request : ... # type: ignore[override]
5658 def patch (self , path : str , data : Optional [Any ] = ..., format : Optional [str ] = ..., content_type : Optional [str ] = ..., follow : bool = ..., ** extra : Any ) -> Request : ... # type: ignore[override]
@@ -71,7 +73,7 @@ class APIClient(APIRequestFactory, DjangoClient):
7173 self , user : Union [AnonymousUser , AbstractBaseUser ] = ..., token : Optional [Token ] = ...
7274 ) -> None : ...
7375 def request (self , ** kwargs : Any ) -> Response : ... # type: ignore[override]
74- def get (self , path : str , data : Optional [ Union [ Dict [ str , Any ], str ]] = ..., follow : bool = ..., ** extra : Any ): ... # type: ignore[override]
76+ def get (self , path : str , data : _GetDataType = ..., follow : bool = ..., ** extra : Any ): ... # type: ignore[override]
7577 def post (self , path : str , data : Optional [Any ] = ..., format : Optional [str ] = ..., content_type : Optional [str ] = ..., follow : bool = ..., ** extra : Any ) -> Response : ... # type: ignore[override]
7678 def put (self , path : str , data : Optional [Any ] = ..., format : Optional [str ] = ..., content_type : Optional [str ] = ..., follow : bool = ..., ** extra : Any ) -> Response : ... # type: ignore[override]
7779 def patch (self , path : str , data : Optional [Any ] = ..., format : Optional [str ] = ..., content_type : Optional [str ] = ..., follow : bool = ..., ** extra : Any ) -> Response : ... # type: ignore[override]
0 commit comments