mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Refs #25969 -- Replaced usage of render_to_response() with render() in tests.
This commit is contained in:
@@ -12,7 +12,9 @@ from django.contrib.auth.models import User
|
||||
from django.contrib.auth.signals import user_logged_in, user_logged_out
|
||||
from django.core.urlresolvers import NoReverseMatch, reverse
|
||||
from django.http import HttpResponse
|
||||
from django.template import Context, TemplateSyntaxError, engines
|
||||
from django.template import (
|
||||
Context, RequestContext, TemplateSyntaxError, engines,
|
||||
)
|
||||
from django.template.response import SimpleTemplateResponse
|
||||
from django.test import (
|
||||
Client, SimpleTestCase, TestCase, ignore_warnings, override_settings,
|
||||
@@ -1021,7 +1023,7 @@ class ContextTests(TestDataMixin, TestCase):
|
||||
def test_single_context(self):
|
||||
"Context variables can be retrieved from a single context"
|
||||
response = self.client.get("/request_data/", data={'foo': 'whiz'})
|
||||
self.assertEqual(response.context.__class__, Context)
|
||||
self.assertIsInstance(response.context, RequestContext)
|
||||
self.assertIn('get-foo', response.context)
|
||||
self.assertEqual(response.context['get-foo'], 'whiz')
|
||||
self.assertEqual(response.context['data'], 'sausage')
|
||||
@@ -1083,7 +1085,7 @@ class ContextTests(TestDataMixin, TestCase):
|
||||
response.context is not lost when view call another view.
|
||||
"""
|
||||
response = self.client.get("/nested_view/")
|
||||
self.assertEqual(response.context.__class__, Context)
|
||||
self.assertIsInstance(response.context, RequestContext)
|
||||
self.assertEqual(response.context['nested'], 'yes')
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user