summaryrefslogtreecommitdiff
path: root/tests/template_tests/test_engine.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-09-03 22:01:30 -0400
committerTim Graham <timograham@gmail.com>2015-09-23 19:31:11 -0400
commit9023696613b278bb96a2ab5744da5c2bac023ad7 (patch)
tree5e088d65e7850758c823422513714757ea5c1485 /tests/template_tests/test_engine.py
parentb3641512c891b653887a90eca8cd3f987682950f (diff)
Removed dictionary and context_instance parameters for render functions.
Per deprecation timeline.
Diffstat (limited to 'tests/template_tests/test_engine.py')
-rw-r--r--tests/template_tests/test_engine.py38
1 files changed, 3 insertions, 35 deletions
diff --git a/tests/template_tests/test_engine.py b/tests/template_tests/test_engine.py
index d2c45b25a9..61ab7259ea 100644
--- a/tests/template_tests/test_engine.py
+++ b/tests/template_tests/test_engine.py
@@ -2,22 +2,17 @@ import os
from django.template import Context
from django.template.engine import Engine
-from django.test import SimpleTestCase, ignore_warnings
-from django.utils.deprecation import RemovedInDjango110Warning
+from django.test import SimpleTestCase
from .utils import ROOT, TEMPLATE_DIR
OTHER_DIR = os.path.join(ROOT, 'other_templates')
-@ignore_warnings(category=RemovedInDjango110Warning)
-class DeprecatedRenderToStringTest(SimpleTestCase):
+class RenderToStringTest(SimpleTestCase):
def setUp(self):
- self.engine = Engine(
- dirs=[TEMPLATE_DIR],
- libraries={'custom': 'template_tests.templatetags.custom'},
- )
+ self.engine = Engine(dirs=[TEMPLATE_DIR])
def test_basic_context(self):
self.assertEqual(
@@ -25,33 +20,6 @@ class DeprecatedRenderToStringTest(SimpleTestCase):
'obj:test\n',
)
- def test_existing_context_kept_clean(self):
- context = Context({'obj': 'before'})
- output = self.engine.render_to_string(
- 'test_context.html', {'obj': 'after'}, context_instance=context,
- )
- self.assertEqual(output, 'obj:after\n')
- self.assertEqual(context['obj'], 'before')
-
- def test_no_empty_dict_pushed_to_stack(self):
- """
- #21741 -- An empty dict should not be pushed to the context stack when
- render_to_string is called without a context argument.
- """
-
- # The stack should have a length of 1, corresponding to the builtins
- self.assertEqual(
- '1',
- self.engine.render_to_string('test_context_stack.html').strip(),
- )
- self.assertEqual(
- '1',
- self.engine.render_to_string(
- 'test_context_stack.html',
- context_instance=Context()
- ).strip(),
- )
-
class LoaderTests(SimpleTestCase):