Skip to content

Commit 4b0e487

Browse files
committed
dont include rest_framework in tests if it is not present
1 parent 4095e28 commit 4b0e487

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

django_enum/tests/settings.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
INSTALLED_APPS = [
4545
'django_enum.tests.djenum',
4646
'django_enum.tests.tmpls',
47-
'rest_framework',
4847
'django.contrib.auth',
4948
'django.contrib.contenttypes',
5049
'django.contrib.sessions',
@@ -54,6 +53,12 @@
5453
'django.contrib.admin',
5554
]
5655

56+
try:
57+
import rest_framework
58+
INSTALLED_APPS.insert(0, 'rest_framework')
59+
except (ImportError, ModuleNotFoundError):
60+
pass
61+
5762
try:
5863
import enum_properties
5964
INSTALLED_APPS.insert(0, 'django_enum.tests.enum_prop')

0 commit comments

Comments
 (0)