Skip to content

5.0: Update django.test #2005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions django-stubs/test/client.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,88 @@ class AsyncClient(ClientMixin, _AsyncRequestFactory[Awaitable[_MonkeyPatchedASGI
**defaults: Any,
) -> None: ...
async def request(self, **request: Any) -> _MonkeyPatchedASGIResponse: ...
async def get( # type: ignore[override]
self,
path: str,
data: _GetDataType = ...,
follow: bool = ...,
secure: bool = ...,
*,
headers: Mapping[str, Any] | None = ...,
**extra: Any,
) -> _MonkeyPatchedASGIResponse: ...
async def post( # type: ignore[override]
self,
path: str,
data: Any = ...,
content_type: str = ...,
follow: bool = ...,
secure: bool = ...,
*,
headers: Mapping[str, Any] | None = ...,
**extra: Any,
) -> _MonkeyPatchedASGIResponse: ...
async def head( # type: ignore[override]
self,
path: str,
data: Any = ...,
follow: bool = ...,
secure: bool = ...,
*,
headers: Mapping[str, Any] | None = ...,
**extra: Any,
) -> _MonkeyPatchedASGIResponse: ...
async def options( # type: ignore[override]
self,
path: str,
data: dict[str, str] | str = ...,
content_type: str = ...,
follow: bool = ...,
secure: bool = ...,
*,
headers: Mapping[str, Any] | None = ...,
**extra: Any,
) -> _MonkeyPatchedASGIResponse: ...
async def put( # type: ignore[override]
self,
path: str,
data: Any = ...,
content_type: str = ...,
follow: bool = ...,
secure: bool = ...,
*,
headers: Mapping[str, Any] | None = ...,
**extra: Any,
) -> _MonkeyPatchedASGIResponse: ...
async def patch( # type: ignore[override]
self,
path: str,
data: Any = ...,
content_type: str = ...,
follow: bool = ...,
secure: bool = ...,
*,
headers: Mapping[str, Any] | None = ...,
**extra: Any,
) -> _MonkeyPatchedASGIResponse: ...
async def delete( # type: ignore[override]
self,
path: str,
data: Any = ...,
content_type: str = ...,
follow: bool = ...,
secure: bool = ...,
*,
headers: Mapping[str, Any] | None = ...,
**extra: Any,
) -> _MonkeyPatchedASGIResponse: ...
async def trace( # type: ignore[override]
self,
path: str,
data: Any = ...,
follow: bool = ...,
secure: bool = ...,
*,
headers: Mapping[str, Any] | None = ...,
**extra: Any,
) -> _MonkeyPatchedASGIResponse: ...
2 changes: 2 additions & 0 deletions django-stubs/test/runner.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class RemoteTestResult:
def stopTestRun(self) -> None: ...
def startTest(self, test: Any) -> None: ...
def stopTest(self, test: Any) -> None: ...
def addDuration(self, test: Any, elapsed: Any) -> None: ...
def addError(self, test: Any, err: Any) -> None: ...
def addFailure(self, test: Any, err: Any) -> None: ...
def addSubTest(self, test: Any, subtest: Any, err: Any) -> None: ...
Expand Down Expand Up @@ -132,6 +133,7 @@ class DiscoverRunner:
timing: bool = ...,
shuffle: int | Literal[False] = ...,
logger: logging.Logger | None = ...,
durations: int | None = ...,
**kwargs: Any,
) -> None: ...
@classmethod
Expand Down
18 changes: 0 additions & 18 deletions scripts/stubtest/allowlist_todo_django50.txt
Original file line number Diff line number Diff line change
Expand Up @@ -227,24 +227,6 @@ django.template.Template.__iter__
django.template.autoreload
django.template.base.Template.__iter__
django.template.defaultfilters.escapeseq
django.test.AsyncClient.delete
django.test.AsyncClient.get
django.test.AsyncClient.head
django.test.AsyncClient.options
django.test.AsyncClient.patch
django.test.AsyncClient.post
django.test.AsyncClient.put
django.test.AsyncClient.trace
django.test.client.AsyncClient.delete
django.test.client.AsyncClient.get
django.test.client.AsyncClient.head
django.test.client.AsyncClient.options
django.test.client.AsyncClient.patch
django.test.client.AsyncClient.post
django.test.client.AsyncClient.put
django.test.client.AsyncClient.trace
django.test.runner.DiscoverRunner.__init__
django.test.runner.RemoteTestResult.addDuration
django.utils.choices
django.utils.deprecation.RemovedInDjango50Warning
django.utils.deprecation.RemovedInDjango60Warning
Expand Down