Skip to content

Commit 23e1e8c

Browse files
Fix missing import and remove now redundant imports
1 parent a2e4cb5 commit 23e1e8c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

pytest_django/fixtures.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ def _django_db_fixture_helper(
154154
transactional: bool = False,
155155
reset_sequences: bool = False,
156156
) -> None:
157+
from django.conf import settings
158+
157159
if is_django_unittest(request):
158160
return
159161

@@ -169,13 +171,15 @@ def _django_db_fixture_helper(
169171
request.addfinalizer(django_db_blocker.restore)
170172

171173
if transactional:
172-
test_case_classname = settings.PYTEST.get(
173-
"PYTEST_TRANSACTION_TEST_CASE",
174+
test_case_classname = getattr(
175+
settings,
176+
"PYTEST_TRANSACTION_TEST_CASE_CLASS",
174177
"django.test.TransactionTestCase"
175178
)
176179
else:
177-
test_case_classname = settings.PYTEST.get(
178-
"PYTEST_TEST_CASE",
180+
test_case_classname = getattr(
181+
settings,
182+
"PYTEST_TEST_CASE_CLASS",
179183
"django.test.TestCase"
180184
)
181185
test_case_class = import_string(test_case_classname)

0 commit comments

Comments
 (0)