aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/runtests
diff options
context:
space:
mode:
authorTom Christie2013-03-18 21:03:05 +0000
committerTom Christie2013-03-18 21:03:05 +0000
commit74fb366c595db87bb71baeffcacfb7d2482e3a18 (patch)
tree2e28cb52542742f32cdd3fbeb625f7f59cba0a3f /rest_framework/runtests
parent4c6396108704d38f534a16577de59178b1d0df3b (diff)
parent034c4ce4081dd6d15ea47fb8318754321a3faf0c (diff)
downloaddjango-rest-framework-74fb366c595db87bb71baeffcacfb7d2482e3a18.tar.bz2
Merge branch 'master' into resources-routers
Diffstat (limited to 'rest_framework/runtests')
-rwxr-xr-xrest_framework/runtests/runcoverage.py7
-rwxr-xr-xrest_framework/runtests/runtests.py2
-rw-r--r--rest_framework/runtests/settings.py32
3 files changed, 37 insertions, 4 deletions
diff --git a/rest_framework/runtests/runcoverage.py b/rest_framework/runtests/runcoverage.py
index bcab1d14..ce11b213 100755
--- a/rest_framework/runtests/runcoverage.py
+++ b/rest_framework/runtests/runcoverage.py
@@ -52,12 +52,15 @@ def main():
if os.path.basename(path) in ['tests', 'runtests', 'migrations']:
continue
- # Drop the compat module from coverage, since we're not interested in the coverage
- # of a module which is specifically for resolving environment dependant imports.
+ # Drop the compat and six modules from coverage, since we're not interested in the coverage
+ # of modules which are specifically for resolving environment dependant imports.
# (Because we'll end up getting different coverage reports for it for each environment)
if 'compat.py' in files:
files.remove('compat.py')
+ if 'six.py' in files:
+ files.remove('six.py')
+
# Same applies to template tags module.
# This module has to include branching on Django versions,
# so it's never possible for it to have full coverage.
diff --git a/rest_framework/runtests/runtests.py b/rest_framework/runtests/runtests.py
index 505994e2..4a333fb3 100755
--- a/rest_framework/runtests/runtests.py
+++ b/rest_framework/runtests/runtests.py
@@ -33,7 +33,7 @@ def main():
elif len(sys.argv) == 1:
test_case = ''
else:
- print usage()
+ print(usage())
sys.exit(1)
failures = test_runner.run_tests(['tests' + test_case])
diff --git a/rest_framework/runtests/settings.py b/rest_framework/runtests/settings.py
index dd5d9dc3..9b519f27 100644
--- a/rest_framework/runtests/settings.py
+++ b/rest_framework/runtests/settings.py
@@ -97,11 +97,41 @@ INSTALLED_APPS = (
# 'django.contrib.admindocs',
'rest_framework',
'rest_framework.authtoken',
- 'rest_framework.tests'
+ 'rest_framework.tests',
)
+# 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',
+ )
+
+try:
+ import provider
+except ImportError:
+ pass
+else:
+ INSTALLED_APPS += (
+ 'provider',
+ 'provider.oauth2',
+ )
+
STATIC_URL = '/static/'
+PASSWORD_HASHERS = (
+ 'django.contrib.auth.hashers.SHA1PasswordHasher',
+ 'django.contrib.auth.hashers.PBKDF2PasswordHasher',
+ 'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
+ 'django.contrib.auth.hashers.BCryptPasswordHasher',
+ 'django.contrib.auth.hashers.MD5PasswordHasher',
+ 'django.contrib.auth.hashers.CryptPasswordHasher',
+)
+
import django
if django.VERSION < (1, 3):