Fixed #26976 -- Added LiveServerTestCase.server_thread_class to ease subclassing.

This commit is contained in:
Chris Jerdonek 2016-08-01 13:15:41 -07:00 committed by Tim Graham
parent 24123c3136
commit 013ee21cf8
2 changed files with 3 additions and 1 deletions

View File

@ -144,6 +144,7 @@ answer newbie questions, and generally made Django that much better:
Chris Bennett <chrisrbennett@yahoo.com>
Chris Cahoon <chris.cahoon@gmail.com>
Chris Chamberlin <dja@cdc.msbx.net>
Chris Jerdonek
Chris Jones <chris@brack3t.com>
Chris Lamb <chris@chris-lamb.co.uk>
Chris Streeter <chris@chrisstreeter.com>

View File

@ -1285,6 +1285,7 @@ class LiveServerTestCase(TransactionTestCase):
other thread can see the changes.
"""
host = 'localhost'
server_thread_class = LiveServerThread
static_handler = _StaticFilesHandler
@classproperty
@ -1321,7 +1322,7 @@ class LiveServerTestCase(TransactionTestCase):
@classmethod
def _create_server_thread(cls, connections_override):
return LiveServerThread(
return cls.server_thread_class(
cls.host,
cls.static_handler,
connections_override=connections_override,