Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow user-specified backend for result testrunner #368

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions djcelery/contrib/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ class CeleryTestSuiteRunnerStoringResult(DiscoverRunner):
"""Django test runner allowing testing of celery delayed tasks,
and storing the results of those tasks in ``TaskMeta``.

Requires setting CELERY_RESULT_BACKEND = 'database'.
Requires setting CELERY_RESULT_BACKEND to be one of:
'database'
'djcelery.backends.database:DatabaseBackend'

USAGE:

Expand All @@ -65,5 +67,8 @@ def on_success_patched(self, retval, task_id, args, kwargs):
**kwargs
)

settings.CELERY_RESULT_BACKEND = 'database'
if not hasattr(settings, 'CELERY_RESULT_BACKEND') or \
settings.CELERY_RESULT_BACKEND not in \
['database', 'djcelery.contrib.test_runner:CeleryTestSuiteRunnerStoringResult']:
settings.CELERY_RESULT_BACKEND = 'database'
_set_eager()