From fc1c9d1770c18c872cb1f4f1f5febc8f264e8add Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Thu, 31 Jan 2019 15:42:29 +0100 Subject: [PATCH] Skip testing Guardian on PY2 See https://github.com/django-guardian/django-guardian/issues/602 --- rest_framework/compat.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rest_framework/compat.py b/rest_framework/compat.py index fffc17938..5a4bcdf66 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -161,6 +161,10 @@ def is_guardian_installed(): """ django-guardian is optional and only imported if in INSTALLED_APPS. """ + if six.PY2: + # Guardian 1.5.0, for Django 2.2 is NOT compatible with Python 2.7. + # Remove when dropping PY2. + return False return 'guardian' in settings.INSTALLED_APPS