mirror of
https://github.com/django/django.git
synced 2025-08-02 18:13:02 +00:00
Cleaned up exception message checking in some tests.
This commit is contained in:
parent
58ad030d05
commit
95b7699ffc
6 changed files with 15 additions and 9 deletions
|
@ -997,8 +997,11 @@ class RequestURLconfTests(SimpleTestCase):
|
|||
Test reversing an URL from the *default* URLconf from inside
|
||||
a response middleware.
|
||||
"""
|
||||
message = "Reverse for 'outer' not found."
|
||||
with self.assertRaisesMessage(NoReverseMatch, message):
|
||||
msg = (
|
||||
"Reverse for 'outer' not found. 'outer' is not a valid view "
|
||||
"function or pattern name."
|
||||
)
|
||||
with self.assertRaisesMessage(NoReverseMatch, msg):
|
||||
self.client.get('/second_test/')
|
||||
|
||||
@override_settings(
|
||||
|
@ -1070,7 +1073,8 @@ class DefaultErrorHandlerTests(SimpleTestCase):
|
|||
response = self.client.get('/test/')
|
||||
self.assertEqual(response.status_code, 404)
|
||||
|
||||
with self.assertRaisesMessage(ValueError, "I don't think I'm getting good"):
|
||||
msg = "I don't think I'm getting good value for this view"
|
||||
with self.assertRaisesMessage(ValueError, msg):
|
||||
self.client.get('/bad_view/')
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue