mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
[1.5.x] Fixed #18417 -- Raised exception when unittest.TestCase is decorated with override_settings
Backport of 9f7cefd5 from master.
This commit is contained in:
@@ -188,7 +188,11 @@ class override_settings(object):
|
||||
|
||||
def __call__(self, test_func):
|
||||
from django.test import TransactionTestCase
|
||||
if isinstance(test_func, type) and issubclass(test_func, TransactionTestCase):
|
||||
if isinstance(test_func, type):
|
||||
if not issubclass(test_func, TransactionTestCase):
|
||||
raise Exception(
|
||||
"Only subclasses of Django TransactionTestCase can be decorated "
|
||||
"with override_settings")
|
||||
original_pre_setup = test_func._pre_setup
|
||||
original_post_teardown = test_func._post_teardown
|
||||
|
||||
|
||||
Reference in New Issue
Block a user