forked from extern/django-helpdesk
Test fix: adding a django.setup() phase
This commit is contained in:
parent
f0156cfcb3
commit
afb0bd25b3
@ -1,8 +1,11 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
|
import django
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
|
|
||||||
class QuickDjangoTest(object):
|
class QuickDjangoTest(object):
|
||||||
"""
|
"""
|
||||||
A quick way to run the Django test suite without a fully-configured project.
|
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,
|
INSTALLED_APPS = self.INSTALLED_APPS + self.apps,
|
||||||
ROOT_URLCONF = self.apps[0] + '.urls',
|
ROOT_URLCONF = self.apps[0] + '.urls',
|
||||||
)
|
)
|
||||||
|
django.setup()
|
||||||
|
|
||||||
from django.test.simple import DjangoTestSuiteRunner
|
from django.test.simple import DjangoTestSuiteRunner
|
||||||
failures = DjangoTestSuiteRunner().run_tests(self.apps, verbosity=1)
|
failures = DjangoTestSuiteRunner().run_tests(self.apps, verbosity=1)
|
||||||
if failures:
|
if failures:
|
||||||
|
Loading…
Reference in New Issue
Block a user