mirror of
https://github.com/django/django.git
synced 2025-11-25 21:22:14 +00:00
Fixed #23789 -- TemplateResponse handles context differently from render
This commit is contained in:
parent
006451f894
commit
b748a8bc67
4 changed files with 28 additions and 4 deletions
|
|
@ -233,6 +233,12 @@ class TemplateResponseTest(TestCase):
|
|||
Context({'foo': 'bar'})).render()
|
||||
self.assertEqual(response.content, b'bar')
|
||||
|
||||
def test_context_processor_priority(self):
|
||||
# context processors should be overridden by passed-in context
|
||||
response = self._response('{{ foo }}{{ processors }}',
|
||||
{'processors': 'no'}).render()
|
||||
self.assertEqual(response.content, b'no')
|
||||
|
||||
def test_kwargs(self):
|
||||
response = self._response(content_type='application/json',
|
||||
status=504)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue