mirror of
https://github.com/Hopiu/django-modeltranslation.git
synced 2026-05-04 19:44:43 +00:00
Setup django in runtests standalone script for Django 1.7.
This commit is contained in:
parent
4efc7ad6c6
commit
9c876b3fde
1 changed files with 8 additions and 4 deletions
12
runtests.py
12
runtests.py
|
|
@ -2,6 +2,7 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
import django
|
||||
from django.conf import settings
|
||||
from django.core.management import call_command
|
||||
|
||||
|
|
@ -34,18 +35,21 @@ def runtests():
|
|||
|
||||
# Configure test environment
|
||||
settings.configure(
|
||||
DATABASES = DATABASES,
|
||||
INSTALLED_APPS = (
|
||||
DATABASES=DATABASES,
|
||||
INSTALLED_APPS=(
|
||||
'modeltranslation',
|
||||
),
|
||||
ROOT_URLCONF = None, # tests override urlconf, but it still needs to be defined
|
||||
LANGUAGES = (
|
||||
ROOT_URLCONF=None, # tests override urlconf, but it still needs to be defined
|
||||
LANGUAGES=(
|
||||
('en', 'English'),
|
||||
),
|
||||
)
|
||||
|
||||
if django.get_version() >= '1.7':
|
||||
django.setup()
|
||||
failures = call_command(
|
||||
'test', 'modeltranslation', interactive=False, failfast=False, verbosity=2)
|
||||
|
||||
sys.exit(bool(failures))
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue