Skip to content

Commit

Permalink
asserts: add assertQuerySetEqual typing
Browse files Browse the repository at this point in the history
Fix #1056.
  • Loading branch information
bluetech committed Apr 5, 2023
1 parent a499110 commit 5f5cc4c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Improvements

* Drop support for Python version 3.6.

* Add precise `pytest_django.asserts.assertQuerySetEqual` typing.

v4.5.2 (2021-12-07)
-------------------

Expand Down
10 changes: 10 additions & 0 deletions pytest_django/asserts.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ def assertXMLNotEqual(
) -> None:
...

# Removed in Django 5.1: use assertQuerySetEqual.
def assertQuerysetEqual(
qs,
values,
Expand All @@ -197,6 +198,15 @@ def assertQuerysetEqual(
) -> None:
...

def assertQuerySetEqual(
qs,
values,
transform=...,
ordered: bool = ...,
msg: Optional[str] = ...,
) -> None:
...

def assertNumQueries(
num: int,
func=...,
Expand Down

0 comments on commit 5f5cc4c

Please sign in to comment.