Upgraded script to be Django 1.7 friendly
This commit is contained in:
+11
-1
@@ -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,9 +47,15 @@ settings.configure(
|
|||||||
'polymorphic',
|
'polymorphic',
|
||||||
),
|
),
|
||||||
SITE_ID = 3,
|
SITE_ID = 3,
|
||||||
|
TEST_RUNNER = test_runner,
|
||||||
|
MIDDLEWARE_CLASSES = (),
|
||||||
)
|
)
|
||||||
|
|
||||||
call_command('syncdb', verbosity=1, interactive=False)
|
if django.VERSION[:2] > (1, 6):
|
||||||
|
django.setup()
|
||||||
|
call_command('migrate', verbosity=1, interactive=False)
|
||||||
|
else:
|
||||||
|
call_command('syncdb', verbosity=1, interactive=False)
|
||||||
|
|
||||||
|
|
||||||
# ---- app start
|
# ---- app start
|
||||||
|
|||||||
Reference in New Issue
Block a user