mirror of
https://github.com/django/django.git
synced 2025-12-04 00:55:36 +00:00
Use assertIsInstance in tests.
Gives much nicer errors when it fails.
This commit is contained in:
parent
18856f866c
commit
09f8652765
31 changed files with 87 additions and 87 deletions
|
|
@ -126,15 +126,15 @@ class DecoratorsTest(TestCase):
|
|||
my_safe_view = require_safe(my_view)
|
||||
request = HttpRequest()
|
||||
request.method = 'GET'
|
||||
self.assertTrue(isinstance(my_safe_view(request), HttpResponse))
|
||||
self.assertIsInstance(my_safe_view(request), HttpResponse)
|
||||
request.method = 'HEAD'
|
||||
self.assertTrue(isinstance(my_safe_view(request), HttpResponse))
|
||||
self.assertIsInstance(my_safe_view(request), HttpResponse)
|
||||
request.method = 'POST'
|
||||
self.assertTrue(isinstance(my_safe_view(request), HttpResponseNotAllowed))
|
||||
self.assertIsInstance(my_safe_view(request), HttpResponseNotAllowed)
|
||||
request.method = 'PUT'
|
||||
self.assertTrue(isinstance(my_safe_view(request), HttpResponseNotAllowed))
|
||||
self.assertIsInstance(my_safe_view(request), HttpResponseNotAllowed)
|
||||
request.method = 'DELETE'
|
||||
self.assertTrue(isinstance(my_safe_view(request), HttpResponseNotAllowed))
|
||||
self.assertIsInstance(my_safe_view(request), HttpResponseNotAllowed)
|
||||
|
||||
|
||||
# For testing method_decorator, a decorator that assumes a single argument.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue