diff --git a/django-stubs/test/client.pyi b/django-stubs/test/client.pyi index 5758239f1..44d50163a 100644 --- a/django-stubs/test/client.pyi +++ b/django-stubs/test/client.pyi @@ -1,3 +1,4 @@ +from collections.abc import Mapping from io import BytesIO from json import JSONEncoder from re import Pattern @@ -47,7 +48,11 @@ class RequestFactory: cookies: SimpleCookie errors: BytesIO def __init__( - self, *, json_encoder: type[JSONEncoder] = ..., **defaults: Any + self, + *, + json_encoder: type[JSONEncoder] = ..., + headers: Mapping[str, Any] | None = ..., + **defaults: Any, ) -> None: ... def request(self, **request: Any) -> WSGIRequest: ... def get( @@ -57,7 +62,8 @@ class RequestFactory: secure: bool = ..., *, QUERY_STRING: str = ..., - **extra: str + headers: Mapping[str, Any] | None = ..., + **extra: str, ) -> WSGIRequest: ... def post( self, @@ -67,7 +73,8 @@ class RequestFactory: secure: bool = ..., *, QUERY_STRING: str = ..., - **extra: str + headers: Mapping[str, Any] | None = ..., + **extra: str, ) -> WSGIRequest: ... def head( self, @@ -76,10 +83,17 @@ class RequestFactory: secure: bool = ..., *, QUERY_STRING: str = ..., - **extra: str + headers: Mapping[str, Any] | None = ..., + **extra: str, ) -> WSGIRequest: ... def trace( - self, path: str, secure: bool = ..., *, QUERY_STRING: str = ..., **extra: str + self, + path: str, + secure: bool = ..., + *, + QUERY_STRING: str = ..., + headers: Mapping[str, Any] | None = ..., + **extra: str, ) -> WSGIRequest: ... def options( self, @@ -89,7 +103,8 @@ class RequestFactory: secure: bool = ..., *, QUERY_STRING: str = ..., - **extra: str + headers: Mapping[str, Any] | None = ..., + **extra: str, ) -> WSGIRequest: ... def put( self, @@ -99,7 +114,8 @@ class RequestFactory: secure: bool = ..., *, QUERY_STRING: str = ..., - **extra: str + headers: Mapping[str, Any] | None = ..., + **extra: str, ) -> WSGIRequest: ... def patch( self, @@ -109,7 +125,8 @@ class RequestFactory: secure: bool = ..., *, QUERY_STRING: str = ..., - **extra: str + headers: Mapping[str, Any] | None = ..., + **extra: str, ) -> WSGIRequest: ... def delete( self, @@ -119,7 +136,8 @@ class RequestFactory: secure: bool = ..., *, QUERY_STRING: str = ..., - **extra: str + headers: Mapping[str, Any] | None = ..., + **extra: str, ) -> WSGIRequest: ... def generic( self, @@ -130,20 +148,23 @@ class RequestFactory: secure: bool = ..., *, QUERY_STRING: str = ..., - **extra: str + headers: Mapping[str, Any] | None = ..., + **extra: str, ) -> WSGIRequest: ... class Client(RequestFactory): handler: ClientHandler raise_request_exception: bool exc_info: tuple[type[BaseException], BaseException, TracebackType] | None + headers: dict[str, Any] def __init__( self, enforce_csrf_checks: bool = ..., raise_request_exception: bool = ..., *, json_encoder: type[JSONEncoder] = ..., - **defaults: Any + headers: Mapping[str, Any] | None = ..., + **defaults: Any, ) -> None: ... # Silence type warnings, since this class overrides arguments and return types in an unsafe manner. def request(self, **request: Any) -> HttpResponse: ... # type: ignore [override] @@ -155,7 +176,8 @@ class Client(RequestFactory): secure: bool = ..., *, QUERY_STRING: str = ..., - **extra: str + headers: Mapping[str, Any] | None = ..., + **extra: str, ) -> HttpResponse: ... def post( # type: ignore [override] self, @@ -166,7 +188,8 @@ class Client(RequestFactory): secure: bool = ..., *, QUERY_STRING: str = ..., - **extra: str + headers: Mapping[str, Any] | None = ..., + **extra: str, ) -> HttpResponse: ... def head( # type: ignore [override] self, @@ -176,7 +199,8 @@ class Client(RequestFactory): secure: bool = ..., *, QUERY_STRING: str = ..., - **extra: str + headers: Mapping[str, Any] | None = ..., + **extra: str, ) -> HttpResponse: ... def trace( # type: ignore [override] self, @@ -186,7 +210,8 @@ class Client(RequestFactory): secure: bool = ..., *, QUERY_STRING: str = ..., - **extra: str + headers: Mapping[str, Any] | None = ..., + **extra: str, ) -> HttpResponse: ... def options( # type: ignore [override] self, @@ -197,7 +222,8 @@ class Client(RequestFactory): secure: bool = ..., *, QUERY_STRING: str = ..., - **extra: str + headers: Mapping[str, Any] | None = ..., + **extra: str, ) -> HttpResponse: ... def put( # type: ignore [override] self, @@ -208,7 +234,8 @@ class Client(RequestFactory): secure: bool = ..., *, QUERY_STRING: str = ..., - **extra: str + headers: Mapping[str, Any] | None = ..., + **extra: str, ) -> HttpResponse: ... def patch( # type: ignore [override] self, @@ -219,7 +246,8 @@ class Client(RequestFactory): secure: bool = ..., *, QUERY_STRING: str = ..., - **extra: str + headers: Mapping[str, Any] | None = ..., + **extra: str, ) -> HttpResponse: ... def delete( # type: ignore [override] self, @@ -230,7 +258,8 @@ class Client(RequestFactory): secure: bool = ..., *, QUERY_STRING: str = ..., - **extra: str + headers: Mapping[str, Any] | None = ..., + **extra: str, ) -> HttpResponse: ... def store_exc_info(self, **kwargs: Any) -> None: ... @property