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):
1818 return application
1919
2020
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+
2128class ChannelsLiveServerTestCase (TransactionTestCase ):
2229 """
2330 Does basically the same as TransactionTestCase but also launches a
@@ -58,7 +65,11 @@ def setUpClass(cls):
5865 make_application ,
5966 static_wrapper = cls .static_wrapper if cls .serve_static else None ,
6067 )
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+ )
6273 cls ._server_process .start ()
6374 while True :
6475 if not cls ._server_process .ready .wait (timeout = 1 ):
You can’t perform that action at this time.
0 commit comments