diff options
| author | Xavier Ordoquy | 2013-05-29 10:18:38 +0200 | 
|---|---|---|
| committer | Xavier Ordoquy | 2013-05-29 10:18:38 +0200 | 
| commit | 732269160f81f69dbf323c33b44e019599f330b6 (patch) | |
| tree | 33efcaa37f23b3f3c5b2d9761c91b38b2afb380e | |
| parent | 1f03b267cf3c2974d3a59125d9fe97b3aa74f573 (diff) | |
| download | django-rest-framework-732269160f81f69dbf323c33b44e019599f330b6.tar.bz2 | |
Use absolute name imports for tests if django version is 1.6+.
| -rwxr-xr-x | rest_framework/runtests/runtests.py | 7 | 
1 files changed, 6 insertions, 1 deletions
diff --git a/rest_framework/runtests/runtests.py b/rest_framework/runtests/runtests.py index 4a333fb3..da36d23f 100755 --- a/rest_framework/runtests/runtests.py +++ b/rest_framework/runtests/runtests.py @@ -10,6 +10,7 @@ import sys  sys.path.append(os.path.join(os.path.dirname(__file__), "../.."))  os.environ['DJANGO_SETTINGS_MODULE'] = 'rest_framework.runtests.settings' +import django  from django.conf import settings  from django.test.utils import get_runner @@ -35,7 +36,11 @@ def main():      else:          print(usage())          sys.exit(1) -    failures = test_runner.run_tests(['tests' + test_case]) +    test_module_name = 'rest_framework.tests' +    if django.VERSION[0] == 1 and django.VERSION[1] < 6: +        test_module_name = 'tests' + +    failures = test_runner.run_tests([test_module_name + test_case])      sys.exit(failures)  | 
