@@ -201,7 +201,7 @@ def django_db_setup(
201
201
)
202
202
203
203
204
- @pytest .fixture ()
204
+ @pytest .fixture
205
205
def _django_db_helper (
206
206
request : pytest .FixtureRequest ,
207
207
django_db_setup : None ,
@@ -365,7 +365,7 @@ def _set_suffix_to_test_databases(suffix: str) -> None:
365
365
# ############### User visible fixtures ################
366
366
367
367
368
- @pytest .fixture ()
368
+ @pytest .fixture
369
369
def db (_django_db_helper : None ) -> None :
370
370
"""Require a django test database.
371
371
@@ -382,7 +382,7 @@ def db(_django_db_helper: None) -> None:
382
382
# The `_django_db_helper` fixture checks if `db` is requested.
383
383
384
384
385
- @pytest .fixture ()
385
+ @pytest .fixture
386
386
def transactional_db (_django_db_helper : None ) -> None :
387
387
"""Require a django test database with transaction support.
388
388
@@ -398,7 +398,7 @@ def transactional_db(_django_db_helper: None) -> None:
398
398
# The `_django_db_helper` fixture checks if `transactional_db` is requested.
399
399
400
400
401
- @pytest .fixture ()
401
+ @pytest .fixture
402
402
def django_db_reset_sequences (
403
403
_django_db_helper : None ,
404
404
transactional_db : None ,
@@ -414,7 +414,7 @@ def django_db_reset_sequences(
414
414
# is requested.
415
415
416
416
417
- @pytest .fixture ()
417
+ @pytest .fixture
418
418
def django_db_serialized_rollback (
419
419
_django_db_helper : None ,
420
420
db : None ,
@@ -435,7 +435,7 @@ def django_db_serialized_rollback(
435
435
# is requested.
436
436
437
437
438
- @pytest .fixture ()
438
+ @pytest .fixture
439
439
def client () -> django .test .Client :
440
440
"""A Django test client instance."""
441
441
skip_if_no_django ()
@@ -445,7 +445,7 @@ def client() -> django.test.Client:
445
445
return Client ()
446
446
447
447
448
- @pytest .fixture ()
448
+ @pytest .fixture
449
449
def async_client () -> django .test .AsyncClient :
450
450
"""A Django test async client instance."""
451
451
skip_if_no_django ()
@@ -455,22 +455,22 @@ def async_client() -> django.test.AsyncClient:
455
455
return AsyncClient ()
456
456
457
457
458
- @pytest .fixture ()
458
+ @pytest .fixture
459
459
def django_user_model (db : None ):
460
460
"""The class of Django's user model."""
461
461
from django .contrib .auth import get_user_model
462
462
463
463
return get_user_model ()
464
464
465
465
466
- @pytest .fixture ()
466
+ @pytest .fixture
467
467
def django_username_field (django_user_model ) -> str :
468
468
"""The fieldname for the username used with Django's user model."""
469
469
field : str = django_user_model .USERNAME_FIELD
470
470
return field
471
471
472
472
473
- @pytest .fixture ()
473
+ @pytest .fixture
474
474
def admin_user (
475
475
db : None ,
476
476
django_user_model ,
@@ -501,7 +501,7 @@ def admin_user(
501
501
return user
502
502
503
503
504
- @pytest .fixture ()
504
+ @pytest .fixture
505
505
def admin_client (
506
506
db : None ,
507
507
admin_user ,
@@ -514,7 +514,7 @@ def admin_client(
514
514
return client
515
515
516
516
517
- @pytest .fixture ()
517
+ @pytest .fixture
518
518
def rf () -> django .test .RequestFactory :
519
519
"""RequestFactory instance"""
520
520
skip_if_no_django ()
@@ -524,7 +524,7 @@ def rf() -> django.test.RequestFactory:
524
524
return RequestFactory ()
525
525
526
526
527
- @pytest .fixture ()
527
+ @pytest .fixture
528
528
def async_rf () -> django .test .AsyncRequestFactory :
529
529
"""AsyncRequestFactory instance"""
530
530
skip_if_no_django ()
@@ -569,7 +569,7 @@ def finalize(self) -> None:
569
569
del self ._to_restore [:]
570
570
571
571
572
- @pytest .fixture ()
572
+ @pytest .fixture
573
573
def settings ():
574
574
"""A Django settings object which restores changes after the testrun"""
575
575
skip_if_no_django ()
@@ -702,13 +702,13 @@ def _assert_num_queries(
702
702
pytest .fail (msg )
703
703
704
704
705
- @pytest .fixture ()
705
+ @pytest .fixture
706
706
def django_assert_num_queries (pytestconfig : pytest .Config ) -> DjangoAssertNumQueries :
707
707
"""Allows to check for an expected number of DB queries."""
708
708
return partial (_assert_num_queries , pytestconfig )
709
709
710
710
711
- @pytest .fixture ()
711
+ @pytest .fixture
712
712
def django_assert_max_num_queries (pytestconfig : pytest .Config ) -> DjangoAssertNumQueries :
713
713
"""Allows to check for an expected maximum number of DB queries."""
714
714
return partial (_assert_num_queries , pytestconfig , exact = False )
@@ -726,7 +726,7 @@ def __call__(
726
726
pass # pragma: no cover
727
727
728
728
729
- @pytest .fixture ()
729
+ @pytest .fixture
730
730
def django_capture_on_commit_callbacks () -> DjangoCaptureOnCommitCallbacks :
731
731
"""Captures transaction.on_commit() callbacks for the given database connection."""
732
732
from django .test import TestCase
0 commit comments