Search code examples
djangocelerydjango-celerydjango-nose

Using django-nose and django-celery together -- unit testing


I have a django project that used django-nose. I'd like to add django-celery to the project. I use unit tests. Both django-nose and django-celery need a TEST_RUNNER setting in my settings.py file. Specifically:

TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'

for django-nose and:

TEST_RUNNER = 'djcelery.contrib.test_runner.CeleryTestSuiteRunner'

for django-celery.

How should I handle this so that I can use both packages?


Solution

  • I found that the best way to handle this is to skip the Celery test runner. I just use decorate my celery-using tests with a @override_settings(CELERY_ALWAYS_EAGER=True) and everything gets tested nicely.