mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 17:09:59 +03:00
Drop Guardian for 1.11 tests, since we're installing an incompatible version
This commit is contained in:
parent
c0fdf84f1d
commit
3d17b03565
|
@ -67,19 +67,22 @@ def pytest_configure(config):
|
||||||
)
|
)
|
||||||
|
|
||||||
# guardian is optional
|
# guardian is optional
|
||||||
try:
|
# Note that for the test cases we're installing a version of django-gaurdian
|
||||||
import guardian # NOQA
|
# that's only compatible with Django 2.0+.
|
||||||
except ImportError:
|
if django.VERSION >= (2, 0, 0):
|
||||||
pass
|
try:
|
||||||
else:
|
import guardian # NOQA
|
||||||
settings.ANONYMOUS_USER_ID = -1
|
except ImportError:
|
||||||
settings.AUTHENTICATION_BACKENDS = (
|
pass
|
||||||
'django.contrib.auth.backends.ModelBackend',
|
else:
|
||||||
'guardian.backends.ObjectPermissionBackend',
|
settings.ANONYMOUS_USER_ID = -1
|
||||||
)
|
settings.AUTHENTICATION_BACKENDS = (
|
||||||
settings.INSTALLED_APPS += (
|
'django.contrib.auth.backends.ModelBackend',
|
||||||
'guardian',
|
'guardian.backends.ObjectPermissionBackend',
|
||||||
)
|
)
|
||||||
|
settings.INSTALLED_APPS += (
|
||||||
|
'guardian',
|
||||||
|
)
|
||||||
|
|
||||||
if config.getoption('--no-pkgroot'):
|
if config.getoption('--no-pkgroot'):
|
||||||
sys.path.pop(0)
|
sys.path.pop(0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user