mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #17228 -- params context variable is inconsistent
Remove the params variable from the context and just put the variables in directly. This had not been committed previously as the original pattern was used in the functional generic views and we wanted consistency between them, but django.views.generic.simple.direct_to_template is now gone so we can do it 'right'.
This commit is contained in:
committed by
Andrew Godwin
parent
212b9826bd
commit
f04bb6d798
@@ -275,7 +275,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.assertEqual(response.context['foo'], 'bar')
|
||||
self.assertTrue(isinstance(response.context['view'], View))
|
||||
|
||||
def test_extra_template_params(self):
|
||||
@@ -284,7 +284,7 @@ class TemplateViewTest(TestCase):
|
||||
"""
|
||||
response = self.client.get('/template/custom/bar/')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(response.context['params'], {'foo': 'bar'})
|
||||
self.assertEqual(response.context['foo'], 'bar')
|
||||
self.assertEqual(response.context['key'], 'value')
|
||||
self.assertTrue(isinstance(response.context['view'], View))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user