Skip to content

Commit

Permalink
Add new names for assert functions from Django 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchainz committed Feb 9, 2023
1 parent 0bb7dbb commit eee7317
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions django-stubs/test/testcases.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,25 @@ class SimpleTestCase(unittest.TestCase):
errors: list[str] | str,
msg_prefix: str = ...,
) -> None: ...
@overload
def assertFormSetError(
self,
formset: BaseFormSet,
form_index: int | None,
field: str | None,
errors: list[str] | str,
msg_prefix: str = ...,
) -> None: ...
@overload
def assertFormSetError(
self,
response: HttpResponseBase,
formset: str,
form_index: int | None,
field: str | None,
errors: list[str] | str,
msg_prefix: str = ...,
) -> None: ...
def assertTemplateUsed(
self,
response: HttpResponseBase | str | None = ...,
Expand Down Expand Up @@ -193,6 +212,14 @@ class TransactionTestCase(SimpleTestCase):
ordered: bool = ...,
msg: str | None = ...,
) -> None: ...
def assertQuerySetEqual(
self,
qs: Iterator[Any] | list[Model] | QuerySet | RawQuerySet,
values: Collection[Any],
transform: Callable[[Model], Any] | type[str] = ...,
ordered: bool = ...,
msg: str | None = ...,
) -> None: ...
@overload
def assertNumQueries(self, num: int, using: str = ...) -> _AssertNumQueriesContext: ... # type: ignore
@overload
Expand Down

0 comments on commit eee7317

Please sign in to comment.