Upgraded script to be Django 1.7 friendly
parent
af4843e54b
commit
e84a2072fc
10
runtests.py
10
runtests.py
|
|
@ -18,6 +18,10 @@ sys.stderr.write('Using Django version {0} from {1}\n'.format(
|
||||||
# Detect location and available modules
|
# Detect location and available modules
|
||||||
module_root = dirname(realpath(__file__))
|
module_root = dirname(realpath(__file__))
|
||||||
|
|
||||||
|
test_runner = 'django.test.runner.DiscoverRunner'
|
||||||
|
if django.VERSION[:2] < (1, 6):
|
||||||
|
test_runner = 'django.test.simple.DjangoTestSuiteRunner'
|
||||||
|
|
||||||
# Inline settings file
|
# Inline settings file
|
||||||
settings.configure(
|
settings.configure(
|
||||||
DEBUG = False, # will be False anyway by DjangoTestRunner.
|
DEBUG = False, # will be False anyway by DjangoTestRunner.
|
||||||
|
|
@ -43,8 +47,14 @@ settings.configure(
|
||||||
'polymorphic',
|
'polymorphic',
|
||||||
),
|
),
|
||||||
SITE_ID = 3,
|
SITE_ID = 3,
|
||||||
|
TEST_RUNNER = test_runner,
|
||||||
|
MIDDLEWARE_CLASSES = (),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if django.VERSION[:2] > (1, 6):
|
||||||
|
django.setup()
|
||||||
|
call_command('migrate', verbosity=1, interactive=False)
|
||||||
|
else:
|
||||||
call_command('syncdb', verbosity=1, interactive=False)
|
call_command('syncdb', verbosity=1, interactive=False)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue