diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/template_tests/test_callables.py | 2 | ||||
| -rw-r--r-- | tests/template_tests/tests.py | 8 | ||||
| -rw-r--r-- | tests/template_tests/utils.py | 16 |
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: |
