Reformat project
This commit is contained in:
@ -9,9 +9,9 @@ from typing import ( # noqa: I100, I201
|
||||
Sequence,
|
||||
Set,
|
||||
TYPE_CHECKING,
|
||||
Tuple,
|
||||
Type,
|
||||
TypeVar,
|
||||
Tuple,
|
||||
Union,
|
||||
cast,
|
||||
)
|
||||
|
||||
@ -195,11 +195,15 @@ async def test_queryset_methods():
|
||||
comps = await Company.objects.all()
|
||||
assert [comp.saved for comp in comps]
|
||||
|
||||
comp2, created = await Company.objects.get_or_create(name="Banzai_new", founded=2001)
|
||||
comp2, created = await Company.objects.get_or_create(
|
||||
name="Banzai_new", founded=2001
|
||||
)
|
||||
assert comp2.saved
|
||||
assert created is True
|
||||
|
||||
comp3, created = await Company.objects.get_or_create(name="Banzai", founded=1988)
|
||||
comp3, created = await Company.objects.get_or_create(
|
||||
name="Banzai", founded=1988
|
||||
)
|
||||
assert comp3.saved
|
||||
assert comp3.pk == comp.pk
|
||||
assert created is False
|
||||
|
||||
@ -107,7 +107,9 @@ async def test_queryset_methods():
|
||||
assert len(post.categories) == 1
|
||||
assert created is False
|
||||
|
||||
category, created = await post.categories.get_or_create(name="Breaking News")
|
||||
category, created = await post.categories.get_or_create(
|
||||
name="Breaking News"
|
||||
)
|
||||
assert category != breaking
|
||||
assert category.pk is not None
|
||||
assert len(post.categories) == 2
|
||||
|
||||
@ -209,7 +209,7 @@ async def test_get_or_create_with_defaults():
|
||||
assert book2.author == "Mojix"
|
||||
assert book2.genre == "Historic"
|
||||
assert await Book.objects.count() == 1
|
||||
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_update_or_create():
|
||||
|
||||
Reference in New Issue
Block a user