#!/usr/bin/env python
import os, sys, re
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'

from django.core.management import call_command

print sys.argv


names = next((a for a in sys.argv[1:] if not a.startswith('-')), None)

if names and re.search(r'^\d+$', names):
    names = 'tests.tests.IssueTests.test_' + names
elif names and not names.startswith('tests.'):
    names = 'tests.tests.' + names
else:
    names = 'tests.tests'

call_command('test', names, failfast='-x' in sys.argv)

@@ -91,16 +91,30 @@
 tings'%0A%0A
+import django%0A
 from dja
@@ -158,24 +158,77 @@
 nd%0A%0A
-print sys.argv%0A%0A
+names_prefix = 'tests.tests' if django.VERSION %3E= (1, 6) else 'tests'
 %0Anam
@@ -349,28 +349,32 @@
 names = 
-'tests.tests
+names_prefix + '
 .IssueTe
@@ -451,28 +451,32 @@
 names = 
-'tests.tests
+names_prefix + '
 .' + nam
@@ -496,29 +496,28 @@
 names = 
-'tests.tests'
+names_prefix
 %0A%0Acall_c

Make ./run_tests.py Class.test compatible across pre/post 1.6 django