Test fix: adding a django.setup() phase

This commit is contained in:
Simon Thépot 2015-01-14 14:10:09 +01:00
parent f0156cfcb3
commit afb0bd25b3

View File

@ -1,8 +1,11 @@
import os
import sys
import argparse
import django
from django.conf import settings
class QuickDjangoTest(object):
"""
A quick way to run the Django test suite without a fully-configured project.
@ -79,6 +82,8 @@ class QuickDjangoTest(object):
INSTALLED_APPS = self.INSTALLED_APPS + self.apps,
ROOT_URLCONF = self.apps[0] + '.urls',
)
django.setup()
from django.test.simple import DjangoTestSuiteRunner
failures = DjangoTestSuiteRunner().run_tests(self.apps, verbosity=1)
if failures: