Draft 0.11.0 (#594)

* fix for #584

* fix for #580

* fix typing

* connect to db in test

* refactor test

* remove async mark

* connect client

* fix mypy

* fix mypy

* update deps

* check py3.10?

* remove py3.6, bump version
This commit is contained in:
collerek
2022-03-28 18:47:35 +02:00
committed by GitHub
parent 8376b6635e
commit 90f78e2fa7
12 changed files with 623 additions and 603 deletions

View File

@ -176,14 +176,15 @@ async def test_queryset_method():
year=1930, title="Book 3"
)
@pytest.mark.asyncio
async def test_count_method():
async with database:
await sample_data()
count = await Author.objects.select_related("books").count()
count = await Author.objects.select_related("books").count()
assert count == 1
# The legacy functionality
count = await Author.objects.select_related("books").count(distinct=False)
count = await Author.objects.select_related("books").count(distinct=False)
assert count == 3