kombu/funtests/tests/test_django.py

33 lines
1.0 KiB
Python
Raw Normal View History

from nose import SkipTest
from kombu.tests.utils import redirect_stdouts
from funtests import transport
class test_django(transport.TransportCase):
2013-04-15 16:44:13 +00:00
transport = 'django'
prefix = 'django'
event_loop_max = 10
def before_connect(self):
@redirect_stdouts
def setup_django(stdout, stderr):
try:
import djkombu # noqa
except ImportError:
2013-04-15 16:44:13 +00:00
raise SkipTest('django-kombu not installed')
from django.conf import settings
if not settings.configured:
2013-04-15 16:44:13 +00:00
settings.configure(DATABASE_ENGINE='sqlite3',
DATABASE_NAME=':memory:',
DATABASES={'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'}},
INSTALLED_APPS=('djkombu', ))
from django.core.management import call_command
2013-04-15 16:44:13 +00:00
call_command('syncdb')
setup_django()