1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #16744 -- Class based view should have the view object in the context

Updated the most recent patch from @claudep to apply again and updated
the documentation location.
This commit is contained in:
Marc Tamlyn
2012-08-18 14:46:17 +01:00
committed by Andrew Godwin
parent 547b181046
commit 58683e9c82
8 changed files with 35 additions and 2 deletions

View File

@@ -276,6 +276,7 @@ class TemplateViewTest(TestCase):
response = self.client.get('/template/simple/bar/')
self.assertEqual(response.status_code, 200)
self.assertEqual(response.context['params'], {'foo': 'bar'})
self.assertTrue(isinstance(response.context['view'], View))
def test_extra_template_params(self):
"""
@@ -285,6 +286,7 @@ class TemplateViewTest(TestCase):
self.assertEqual(response.status_code, 200)
self.assertEqual(response.context['params'], {'foo': 'bar'})
self.assertEqual(response.context['key'], 'value')
self.assertTrue(isinstance(response.context['view'], View))
def test_cached_views(self):
"""