File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,13 @@ def make_application(*, static_wrapper):
18
18
return application
19
19
20
20
21
+ def set_database_connection ():
22
+ from django .conf import settings
23
+
24
+ test_db_name = settings .DATABASES ["default" ]["TEST" ]["NAME" ]
25
+ settings .DATABASES ["default" ]["NAME" ] = test_db_name
26
+
27
+
21
28
class ChannelsLiveServerTestCase (TransactionTestCase ):
22
29
"""
23
30
Does basically the same as TransactionTestCase but also launches a
@@ -58,7 +65,11 @@ def setUpClass(cls):
58
65
make_application ,
59
66
static_wrapper = cls .static_wrapper if cls .serve_static else None ,
60
67
)
61
- cls ._server_process = cls .ProtocolServerProcess (cls .host , get_application )
68
+ cls ._server_process = cls .ProtocolServerProcess (
69
+ cls .host ,
70
+ get_application ,
71
+ setup = set_database_connection ,
72
+ )
62
73
cls ._server_process .start ()
63
74
while True :
64
75
if not cls ._server_process .ready .wait (timeout = 1 ):
You can’t perform that action at this time.
0 commit comments