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

Set context.template instead of context.engine while rendering.

This opens more possibilities, like accessing context.template.origin.

It also follows the chain of objects instead of following a shortcut.
This commit is contained in:
Aymeric Augustin
2015-02-17 22:49:59 +01:00
parent efb1f99f94
commit 1bfcc950ab
8 changed files with 53 additions and 48 deletions

View File

@@ -516,9 +516,6 @@ class RequestContextTests(unittest.TestCase):
self.assertEqual(len(ctx.dicts), 3)
def test_context_comparable(self):
# Create an engine without any context processors.
engine = Engine()
test_data = {'x': 'y', 'v': 'z', 'd': {'o': object, 'a': 'b'}}
# test comparing RequestContext to prevent problems if somebody
@@ -526,8 +523,8 @@ class RequestContextTests(unittest.TestCase):
request = RequestFactory().get('/')
self.assertEqual(
RequestContext(request, dict_=test_data, engine=engine),
RequestContext(request, dict_=test_data, engine=engine))
RequestContext(request, dict_=test_data),
RequestContext(request, dict_=test_data))
@ignore_warnings(category=RemovedInDjango20Warning)