From d10775ef845dee83e6815815dce5d56d8a661a7f Mon Sep 17 00:00:00 2001 From: Josh Thomas Date: Fri, 24 Feb 2023 15:07:32 -0600 Subject: [PATCH 1/2] Allow user arg in `APIClient.force_authenticate` to be `None` --- rest_framework-stubs/test.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework-stubs/test.pyi b/rest_framework-stubs/test.pyi index 62cc38b3d..c891eabf8 100644 --- a/rest_framework-stubs/test.pyi +++ b/rest_framework-stubs/test.pyi @@ -74,7 +74,7 @@ class ForceAuthClientHandler(ClientHandler): class APIClient(APIRequestFactory, DjangoClient): def credentials(self, **kwargs: Any): ... - def force_authenticate(self, user: AnonymousUser | AbstractBaseUser = ..., token: Token | None = ...) -> None: ... + def force_authenticate(self, user: AnonymousUser | AbstractBaseUser | None = ..., token: Token | None = ...) -> None: ... def request(self, **kwargs: Any) -> _MonkeyPatchedResponse: ... # type: ignore[override] def get(self, path: str, data: _GetDataType = ..., follow: bool = ..., **extra: Any) -> _MonkeyPatchedResponse: ... # type: ignore[override] def post(self, path: str, data: Any | None = ..., format: str | None = ..., content_type: str | None = ..., follow: bool = ..., **extra: Any) -> _MonkeyPatchedResponse: ... # type: ignore[override] From 83681ab115fcd37d777d60334539ae6fd1ccbb8f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 24 Feb 2023 21:10:14 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks --- rest_framework-stubs/test.pyi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rest_framework-stubs/test.pyi b/rest_framework-stubs/test.pyi index c891eabf8..b5dca1581 100644 --- a/rest_framework-stubs/test.pyi +++ b/rest_framework-stubs/test.pyi @@ -74,7 +74,9 @@ class ForceAuthClientHandler(ClientHandler): class APIClient(APIRequestFactory, DjangoClient): def credentials(self, **kwargs: Any): ... - def force_authenticate(self, user: AnonymousUser | AbstractBaseUser | None = ..., token: Token | None = ...) -> None: ... + def force_authenticate( + self, user: AnonymousUser | AbstractBaseUser | None = ..., token: Token | None = ... + ) -> None: ... def request(self, **kwargs: Any) -> _MonkeyPatchedResponse: ... # type: ignore[override] def get(self, path: str, data: _GetDataType = ..., follow: bool = ..., **extra: Any) -> _MonkeyPatchedResponse: ... # type: ignore[override] def post(self, path: str, data: Any | None = ..., format: str | None = ..., content_type: str | None = ..., follow: bool = ..., **extra: Any) -> _MonkeyPatchedResponse: ... # type: ignore[override]