Kaydet (Commit) 12efef06 authored tarafından Russell Keith-Magee's avatar Russell Keith-Magee

Fixed #6031 -- Added error handling for _pre_test in django.test.TestCase;…

Fixed #6031 -- Added error handling for _pre_test in django.test.TestCase; exceptions during pre-test setup are now reported as test failures, rather than crashing the entire test framework. Thanks, Thomas Guttler <hv@tbz-pariv.de>.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7023 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst fd20365b
......@@ -70,7 +70,12 @@ class TestCase(unittest.TestCase):
include a call to super().setUp().
"""
self.client = Client()
self._pre_setup()
try:
self._pre_setup()
except Exception:
import sys
result.addError(self, sys.exc_info())
return
super(TestCase, self).__call__(result)
def assertRedirects(self, response, expected_url, status_code=302,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment