Skip to content

Commit

Permalink
fixtures: drop compat code for no longer supported Django versions
Browse files Browse the repository at this point in the history
  • Loading branch information
bluetech committed Sep 28, 2024
1 parent 1157a7c commit 113b578
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions pytest_django/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ def _django_db_helper(
django_db_setup: None,
django_db_blocker: DjangoDbBlocker,
) -> Generator[None, None, None]:
from django import VERSION

if is_django_unittest(request):
yield
return
Expand Down Expand Up @@ -240,13 +238,9 @@ class PytestDjangoTestCase(test_case_class): # type: ignore[misc,valid-type]
@classmethod
def setUpClass(cls) -> None:
super(django.test.TestCase, cls).setUpClass()
if VERSION < (4, 1):
django.db.transaction.Atomic._ensure_durability = False

@classmethod
def tearDownClass(cls) -> None:
if VERSION < (4, 1):
django.db.transaction.Atomic._ensure_durability = True
super(django.test.TestCase, cls).tearDownClass()

PytestDjangoTestCase.setUpClass()
Expand All @@ -260,8 +254,7 @@ def tearDownClass(cls) -> None:

PytestDjangoTestCase.tearDownClass()

if VERSION >= (4, 0):
PytestDjangoTestCase.doClassCleanups()
PytestDjangoTestCase.doClassCleanups()

django_db_blocker.restore()

Expand Down

0 comments on commit 113b578

Please sign in to comment.