2010-11-12 10:34:13 +00:00
|
|
|
from nose import SkipTest
|
|
|
|
|
|
|
|
from kombu.tests.utils import redirect_stdouts
|
|
|
|
|
2010-11-12 10:50:18 +00:00
|
|
|
from funtests import transport
|
|
|
|
|
2010-11-12 10:34:13 +00:00
|
|
|
|
|
|
|
class test_django(transport.TransportCase):
|
|
|
|
transport = "django"
|
|
|
|
prefix = "django"
|
|
|
|
event_loop_max = 10
|
|
|
|
|
|
|
|
def before_connect(self):
|
|
|
|
|
|
|
|
@redirect_stdouts
|
|
|
|
def setup_django(stdout, stderr):
|
|
|
|
try:
|
2011-04-21 16:29:51 +00:00
|
|
|
import djkombu # noqa
|
2010-11-12 10:34:13 +00:00
|
|
|
except ImportError:
|
|
|
|
raise SkipTest("django-kombu not installed")
|
|
|
|
from django.conf import settings
|
|
|
|
if not settings.configured:
|
|
|
|
settings.configure(DATABASE_ENGINE="sqlite3",
|
|
|
|
DATABASE_NAME=":memory:",
|
2012-01-11 15:27:38 +00:00
|
|
|
DATABASES={"default": {
|
|
|
|
"ENGINE": "django.db.backends.sqlite3",
|
|
|
|
"NAME": ":memory:"}},
|
2010-11-12 10:34:13 +00:00
|
|
|
INSTALLED_APPS=("djkombu", ))
|
|
|
|
from django.core.management import call_command
|
|
|
|
call_command("syncdb")
|
|
|
|
|
|
|
|
setup_django()
|