diff options
| author | Berker Peksag <berker.peksag@gmail.com> | 2014-10-28 12:02:56 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-11-03 11:56:37 -0500 |
| commit | f7969b0920c403118656f6bfec58d6454d79ef1a (patch) | |
| tree | 866df7de0524251323fef2b4262e672150d95f00 /tests/view_tests | |
| parent | c0c78f1b707f825eee974c65515a837f8cf46e66 (diff) | |
Fixed #23620 -- Used more specific assertions in the Django test suite.
Diffstat (limited to 'tests/view_tests')
| -rw-r--r-- | tests/view_tests/tests/test_debug.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/view_tests/tests/test_debug.py b/tests/view_tests/tests/test_debug.py index ffe4daec93..e50a29f1d1 100644 --- a/tests/view_tests/tests/test_debug.py +++ b/tests/view_tests/tests/test_debug.py @@ -115,7 +115,7 @@ class DebugViewTests(TestCase): # '<div class="context" id="c38123208">', not '<div class="context" id="c38,123,208"' self.assertContains(response, '<div class="context" id="', status_code=500) match = re.search(b'<div class="context" id="(?P<id>[^"]+)">', response.content) - self.assertFalse(match is None) + self.assertIsNotNone(match) id_repr = match.group('id') self.assertFalse(re.search(b'[^c0-9]', id_repr), "Numeric IDs in debug response HTML page shouldn't be localized (value: %s)." % id_repr) @@ -126,7 +126,7 @@ class DebugViewTests(TestCase): self.client.get(reverse('template_exception', args=(n,))) except Exception: raising_loc = inspect.trace()[-1][-2][0].strip() - self.assertFalse(raising_loc.find('raise BrokenException') == -1, + self.assertNotEqual(raising_loc.find('raise BrokenException'), -1, "Failed to find 'raise BrokenException' in last frame of traceback, instead found: %s" % raising_loc) |
