summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2014-12-14 23:13:03 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2014-12-28 17:02:30 +0100
commitd3a982556d655adcf4ba331d2def685d8249170f (patch)
tree10cb8daafc5aeffdfd7fc962bf27b6e36409b93f /tests
parent3dc01aaaaf7cf070933a8f5ee9a5f9136503d676 (diff)
Deprecated TEMPLATE_STRING_IF_INVALID.
Diffstat (limited to 'tests')
-rw-r--r--tests/template_tests/test_callables.py2
-rw-r--r--tests/template_tests/tests.py8
-rw-r--r--tests/template_tests/utils.py16
3 files changed, 16 insertions, 10 deletions
diff --git a/tests/template_tests/test_callables.py b/tests/template_tests/test_callables.py
index 9a47a5b96f..5536b382ff 100644
--- a/tests/template_tests/test_callables.py
+++ b/tests/template_tests/test_callables.py
@@ -53,7 +53,7 @@ class CallableVariablesTests(TestCase):
c = template.Context({"my_doodad": my_doodad})
# Since ``my_doodad.alters_data`` is True, the template system will not
- # try to call our doodad but will use TEMPLATE_STRING_IF_INVALID
+ # try to call our doodad but will use string_if_invalid
t = template.Template('{{ my_doodad.value }}')
self.assertEqual(t.render(c), '')
t = template.Template('{{ my_doodad.the_value }}')
diff --git a/tests/template_tests/tests.py b/tests/template_tests/tests.py
index 0466f91c7a..5128fd64d5 100644
--- a/tests/template_tests/tests.py
+++ b/tests/template_tests/tests.py
@@ -258,7 +258,13 @@ class TemplateRegressionTests(SimpleTestCase):
with self.assertRaises(urlresolvers.NoReverseMatch):
t.render(c)
- @override_settings(TEMPLATE_STRING_IF_INVALID='%s is invalid', SETTINGS_MODULE='also_something')
+ @override_settings(
+ TEMPLATES=[{
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
+ 'OPTIONS': {'string_if_invalid': '%s is invalid'},
+ }],
+ SETTINGS_MODULE='also_something',
+ )
def test_url_reverse_view_name(self):
# Regression test for #19827
t = Template('{% url will_not_match %}')
diff --git a/tests/template_tests/utils.py b/tests/template_tests/utils.py
index 864cd7d044..3c37be18e4 100644
--- a/tests/template_tests/utils.py
+++ b/tests/template_tests/utils.py
@@ -22,14 +22,14 @@ def setup(templates, *args):
"""
Runs test method multiple times in the following order:
- TEMPLATE_DEBUG CACHED TEMPLATE_STRING_IF_INVALID
- -------------- ------ --------------------------
- False False
- False True
- False False INVALID
- False True INVALID
- True False
- True True
+ debug cached string_if_invalid
+ ----- ------ -----------------
+ False False
+ False True
+ False False INVALID
+ False True INVALID
+ True False
+ True True
"""
for arg in args: