def run_tests(test_labels, *args, **kwargs): """Django test runner allowing testing of celery delayed tasks. All tasks are run locally, not in a worker. To use this runner set ``settings.TEST_RUNNER``:: TEST_RUNNER = "celery.contrib.test_runner.run_tests" """ settings.CELERY_ALWAYS_EAGER = True return run_tests_orig(test_labels, *args, **kwargs)
def run_tests(test_labels, *args, **kwargs): """Django test runner allowing testing of celery delayed tasks and setting the mongo db to be a test DB. For celery All tasks are run locally, not in a worker. """ with_mongo = False if hasattr(settings, 'MONGO_DB_NAME'): with_mongo = True with_celery = False if 'celery' in settings.INSTALLED_APPS: with_celery = True if with_mongo: _setup_mongo() if with_celery: _setup_celery() return run_tests_orig(test_labels, *args, **kwargs) if with_mongo: _teardown_mongo()
def run_tests(test_labels, *args, **kwargs): settings.CELERY_ALWAYS_EAGER = True return run_tests_orig(test_labels, *args, **kwargs)