diff options
| author | Justin Bronn <jbronn@gmail.com> | 2008-01-28 15:35:46 +0000 |
|---|---|---|
| committer | Justin Bronn <jbronn@gmail.com> | 2008-01-28 15:35:46 +0000 |
| commit | 00292ad02ebf9ff1cb09d586c2452b3a716fd601 (patch) | |
| tree | 2ffd3546659f49b2eed2626ab5cfdf508ba69fbf /django/test | |
| parent | 398eca3fb2ac84304b179fabd2f0960228c59b09 (diff) | |
gis: Merged revisions 6990-7043 via svnmerge from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@7044 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/test')
| -rw-r--r-- | django/test/testcases.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/django/test/testcases.py b/django/test/testcases.py index 1d65ee1d23..f524f1c34d 100644 --- a/django/test/testcases.py +++ b/django/test/testcases.py @@ -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, @@ -103,7 +108,7 @@ class TestCase(unittest.TestCase): def assertContains(self, response, text, count=None, status_code=200): """ - Asserts that a response indicates that a page was retreived + Asserts that a response indicates that a page was retrieved successfully, (i.e., the HTTP status code was as expected), and that ``text`` occurs ``count`` times in the content of the response. If ``count`` is None, the count doesn't matter - the assertion is true |
