1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

Fixed #14378 -- Made the test client class customizable. Thanks to Ned Batchelder for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14058 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2010-10-09 04:50:47 +00:00
parent 816c7d1e64
commit b7a73cf929
3 changed files with 41 additions and 1 deletions

View File

@@ -210,6 +210,10 @@ class DocTestRunner(doctest.DocTestRunner):
transaction.rollback_unless_managed(using=conn)
class TransactionTestCase(unittest.TestCase):
# The class we'll use for the test client self.client.
# Can be overridden in derived classes.
client_class = Client
def _pre_setup(self):
"""Performs any pre-test setup. This includes:
@@ -251,7 +255,7 @@ class TransactionTestCase(unittest.TestCase):
set up. This means that user-defined Test Cases aren't required to
include a call to super().setUp().
"""
self.client = Client()
self.client = self.client_class()
try:
self._pre_setup()
except (KeyboardInterrupt, SystemExit):