diff options
author | Jenkins <jenkins@review.openstack.org> | 2014-09-19 02:13:24 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2014-09-19 02:13:24 +0000 |
commit | 455aaeab8d16fbecebe9a088e10e0e532a3116cb (patch) | |
tree | 16270e64e37cfbab78bb196e5da6968aa231c4c3 | |
parent | 614630546a23e59789ee8fefab0b60aaf7533143 (diff) | |
parent | 6d17375a9e481085a0d5a0219a29c77f7de5f108 (diff) | |
download | django_openstack_auth-455aaeab8d16fbecebe9a088e10e0e532a3116cb.tar.gz |
Merge "Fix Django 1.7 compat"
-rw-r--r-- | openstack_auth/forms.py | 3 | ||||
-rw-r--r-- | openstack_auth/tests/run_tests.py | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/openstack_auth/forms.py b/openstack_auth/forms.py index 83a5a6a..2c8092c 100644 --- a/openstack_auth/forms.py +++ b/openstack_auth/forms.py @@ -100,5 +100,6 @@ class Login(django_auth_forms.AuthenticationForm): LOG.warning(msg) self.request.session.flush() raise forms.ValidationError(exc) - self.check_for_test_cookie() + if hasattr(self, 'check_for_test_cookie'): # Dropped in django 1.7 + self.check_for_test_cookie() return self.cleaned_data diff --git a/openstack_auth/tests/run_tests.py b/openstack_auth/tests/run_tests.py index 0252903..46c474c 100644 --- a/openstack_auth/tests/run_tests.py +++ b/openstack_auth/tests/run_tests.py @@ -21,6 +21,10 @@ os.environ['DJANGO_SETTINGS_MODULE'] = 'openstack_auth.tests.settings' from django.test import simple as test_simple +import django +if hasattr(django, 'setup'): + django.setup() + def run(*test_args): if not test_args: |