From a4304458f5a07acc400b7630a59a4a0996e166d9 Mon Sep 17 00:00:00 2001 From: swistakm Date: Tue, 26 Feb 2013 11:27:06 +0100 Subject: runtest.settings fixed if django-oauth-plus or oauth2 are not installed oauth_provider can be added to INSTALLED_APPS only if these packages are installed --- rest_framework/runtests/settings.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'rest_framework/runtests') diff --git a/rest_framework/runtests/settings.py b/rest_framework/runtests/settings.py index 683669ce..eb3f1115 100644 --- a/rest_framework/runtests/settings.py +++ b/rest_framework/runtests/settings.py @@ -98,10 +98,18 @@ INSTALLED_APPS = ( 'rest_framework', 'rest_framework.authtoken', 'rest_framework.tests', - 'oauth_provider', - ) +# OAuth is optional and won't work if there is no oauth_provider & oauth2 +try: + import oauth_provider + import oauth2 +except ImportError: + pass +else: + INSTALLED_APPS += ('oauth_provider',) + + STATIC_URL = '/static/' PASSWORD_HASHERS = ( -- cgit v1.2.3