mirror of
https://github.com/django/django.git
synced 2025-06-12 15:09:12 +00:00
Don't enqueue on commit on tests with no DB connection
This commit is contained in:
parent
673f061ee2
commit
499d040b0b
@ -11,7 +11,12 @@ from . import tasks as test_tasks
|
||||
|
||||
|
||||
@override_settings(
|
||||
TASKS={"default": {"BACKEND": "django.tasks.backends.dummy.DummyBackend"}}
|
||||
TASKS={
|
||||
"default": {
|
||||
"BACKEND": "django.tasks.backends.dummy.DummyBackend",
|
||||
"ENQUEUE_ON_COMMIT": False,
|
||||
}
|
||||
}
|
||||
)
|
||||
class DummyBackendTestCase(SimpleTestCase):
|
||||
def setUp(self):
|
||||
|
@ -12,7 +12,12 @@ from . import tasks as test_tasks
|
||||
|
||||
|
||||
@override_settings(
|
||||
TASKS={"default": {"BACKEND": "django.tasks.backends.immediate.ImmediateBackend"}}
|
||||
TASKS={
|
||||
"default": {
|
||||
"BACKEND": "django.tasks.backends.immediate.ImmediateBackend",
|
||||
"ENQUEUE_ON_COMMIT": False,
|
||||
}
|
||||
}
|
||||
)
|
||||
class ImmediateBackendTestCase(SimpleTestCase):
|
||||
def test_using_correct_backend(self):
|
||||
|
@ -28,6 +28,7 @@ from . import tasks as test_tasks
|
||||
"default": {
|
||||
"BACKEND": "django.tasks.backends.dummy.DummyBackend",
|
||||
"QUEUES": ["default", "queue_1"],
|
||||
"ENQUEUE_ON_COMMIT": False,
|
||||
},
|
||||
"immediate": {"BACKEND": "django.tasks.backends.immediate.ImmediateBackend"},
|
||||
"missing": {"BACKEND": "does.not.exist"},
|
||||
|
Loading…
x
Reference in New Issue
Block a user