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

Made template response APIs enforce the use of dict and backend-specific template objects.

Per deprecation timeline; refs 79deb6a071.
This commit is contained in:
Tim Graham
2015-09-05 12:06:34 -04:00
parent e6cfa08f2d
commit 9af3c6b9ce
3 changed files with 4 additions and 110 deletions

View File

@@ -5,15 +5,12 @@ import time
from datetime import datetime
from django.conf import settings
from django.template import Context, engines
from django.template import engines
from django.template.response import (
ContentNotRenderedError, SimpleTemplateResponse, TemplateResponse,
)
from django.test import (
RequestFactory, SimpleTestCase, ignore_warnings, override_settings,
)
from django.test import RequestFactory, SimpleTestCase, override_settings
from django.test.utils import require_jinja2
from django.utils.deprecation import RemovedInDjango110Warning
from .utils import TEMPLATE_DIR
@@ -118,14 +115,6 @@ class SimpleTemplateResponseTest(SimpleTestCase):
response.render()
self.assertEqual(response.content, b'bar')
@ignore_warnings(category=RemovedInDjango110Warning)
def test_context_instance(self):
response = self._response('{{ foo }}{{ processors }}',
Context({'foo': 'bar'}))
self.assertEqual(response.context_data.__class__, Context)
response.render()
self.assertEqual(response.content, b'bar')
def test_kwargs(self):
response = self._response(content_type='application/json', status=504)
self.assertEqual(response['content-type'], 'application/json')