mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 08:59:54 +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
|
||||
try:
|
||||
import guardian # NOQA
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
settings.ANONYMOUS_USER_ID = -1
|
||||
settings.AUTHENTICATION_BACKENDS = (
|
||||
'django.contrib.auth.backends.ModelBackend',
|
||||
'guardian.backends.ObjectPermissionBackend',
|
||||
)
|
||||
settings.INSTALLED_APPS += (
|
||||
'guardian',
|
||||
)
|
||||
# Note that for the test cases we're installing a version of django-gaurdian
|
||||
# that's only compatible with Django 2.0+.
|
||||
if django.VERSION >= (2, 0, 0):
|
||||
try:
|
||||
import guardian # NOQA
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
settings.ANONYMOUS_USER_ID = -1
|
||||
settings.AUTHENTICATION_BACKENDS = (
|
||||
'django.contrib.auth.backends.ModelBackend',
|
||||
'guardian.backends.ObjectPermissionBackend',
|
||||
)
|
||||
settings.INSTALLED_APPS += (
|
||||
'guardian',
|
||||
)
|
||||
|
||||
if config.getoption('--no-pkgroot'):
|
||||
sys.path.pop(0)
|
||||
|
|
Loading…
Reference in New Issue
Block a user