We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f17a8fe commit 5038d69Copy full SHA for 5038d69
channels/testing/live.py
@@ -4,6 +4,7 @@
4
from django.contrib.staticfiles.handlers import ASGIStaticFilesHandler
5
from django.core.exceptions import ImproperlyConfigured
6
from django.db import connections
7
+from django.db.backends.base.creation import TEST_DATABASE_PREFIX
8
from django.test.testcases import TransactionTestCase
9
from django.test.utils import modify_settings
10
@@ -22,6 +23,8 @@ def set_database_connection():
22
23
from django.conf import settings
24
25
test_db_name = settings.DATABASES["default"]["TEST"]["NAME"]
26
+ if not test_db_name:
27
+ test_db_name = TEST_DATABASE_PREFIX + settings.DATABASES["default"]["NAME"]
28
settings.DATABASES["default"]["NAME"] = test_db_name
29
30
0 commit comments