diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2011-02-01 15:13:56 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2011-02-01 15:13:56 +0000 |
| commit | 67a2bb6341caa1fbf6dce7d9dbac8800b33e9d04 (patch) | |
| tree | eec8d59bd88e12e8b53513c8bb2223bac4433d56 | |
| parent | 7aad3d3fa8a8db8eb8ea9e64134d60b2400029f0 (diff) | |
Modified the test case from r15383 to avoid an output inconsistency with KeyError.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15387 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | tests/regressiontests/views/tests/debug.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/regressiontests/views/tests/debug.py b/tests/regressiontests/views/tests/debug.py index 0b07b406d0..9457a2ee76 100644 --- a/tests/regressiontests/views/tests/debug.py +++ b/tests/regressiontests/views/tests/debug.py @@ -64,12 +64,12 @@ class ExceptionReporterTests(TestCase): "A simple exception report can be generated" try: request = self.rf.get('/test_view/') - raise KeyError("Can't find my keys") - except KeyError: + raise ValueError("Can't find my keys") + except ValueError: exc_type, exc_value, tb = sys.exc_info() reporter = ExceptionReporter(request, exc_type, exc_value, tb) html = reporter.get_traceback_html() - self.assertIn('<h1>KeyError at /test_view/</h1>', html) + self.assertIn('<h1>ValueError at /test_view/</h1>', html) self.assertIn('<pre class="exception_value">Can't find my keys</pre>', html) self.assertIn('<th>Request Method:</th>', html) self.assertIn('<th>Request URL:</th>', html) @@ -82,12 +82,12 @@ class ExceptionReporterTests(TestCase): def test_no_request(self): "An exception report can be generated without request" try: - raise KeyError("Can't find my keys") - except KeyError: + raise ValueError("Can't find my keys") + except ValueError: exc_type, exc_value, tb = sys.exc_info() reporter = ExceptionReporter(None, exc_type, exc_value, tb) html = reporter.get_traceback_html() - self.assertIn('<h1>KeyError</h1>', html) + self.assertIn('<h1>ValueError</h1>', html) self.assertIn('<pre class="exception_value">Can't find my keys</pre>', html) self.assertNotIn('<th>Request Method:</th>', html) self.assertNotIn('<th>Request URL:</th>', html) |
