Loading django/template/context.py +2 −1 Original line number Diff line number Diff line Loading @@ -232,5 +232,6 @@ class RequestContext(Context): new_context = super(RequestContext, self).new(values) # This is for backwards-compatibility: RequestContexts created via # Context.new don't include values from context processors. if hasattr(new_context, '_processors_index'): del new_context._processors_index return new_context tests/template_tests/test_context.py +6 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,8 @@ from unittest import TestCase from django.template import Context, Variable, VariableDoesNotExist from django.http import HttpRequest from django.template import Context, RequestContext, Variable, VariableDoesNotExist from django.template.context import RenderContext Loading Loading @@ -83,3 +84,7 @@ class ContextTests(TestCase): # make contexts equals again b.update({'a': 1}) self.assertEqual(a, b) def test_copy_request_context_twice(self): # Regression test for #24273 - this doesn't raise an exception RequestContext(HttpRequest()).new().new() Loading
django/template/context.py +2 −1 Original line number Diff line number Diff line Loading @@ -232,5 +232,6 @@ class RequestContext(Context): new_context = super(RequestContext, self).new(values) # This is for backwards-compatibility: RequestContexts created via # Context.new don't include values from context processors. if hasattr(new_context, '_processors_index'): del new_context._processors_index return new_context
tests/template_tests/test_context.py +6 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,8 @@ from unittest import TestCase from django.template import Context, Variable, VariableDoesNotExist from django.http import HttpRequest from django.template import Context, RequestContext, Variable, VariableDoesNotExist from django.template.context import RenderContext Loading Loading @@ -83,3 +84,7 @@ class ContextTests(TestCase): # make contexts equals again b.update({'a': 1}) self.assertEqual(a, b) def test_copy_request_context_twice(self): # Regression test for #24273 - this doesn't raise an exception RequestContext(HttpRequest()).new().new()