diff options
| author | Maxime Turcotte <maxime.turcotte@savoirfairelinux.com> | 2014-03-27 16:24:19 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-03-28 18:55:06 -0400 |
| commit | 5e4e0b6fe97c6c9de8355f8738403691637a0b07 (patch) | |
| tree | f71f9982175d42cc72ab1a646bdfb3a2ddeba64b /tests | |
| parent | 12e9adcd71efa36234b697e47fbf59c8117e29a1 (diff) | |
Fixed #22306 -- Deprecated future versions of cycle and firstof template tags.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/template_tests/tests.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/template_tests/tests.py b/tests/template_tests/tests.py index f6cd354046..00ef9f41cf 100644 --- a/tests/template_tests/tests.py +++ b/tests/template_tests/tests.py @@ -17,7 +17,7 @@ from django.template.loaders import app_directories, filesystem, cached from django.test import RequestFactory, TestCase from django.test.utils import (setup_test_template_loader, restore_template_loaders, override_settings, extend_sys_path) -from django.utils.deprecation import RemovedInDjango19Warning +from django.utils.deprecation import RemovedInDjango19Warning, RemovedInDjango20Warning from django.utils.encoding import python_2_unicode_compatible from django.utils.formats import date_format from django.utils._os import upath @@ -511,7 +511,7 @@ class TemplateRegressionTests(TestCase): def test_ifchanged_render_once(self): """ Test for ticket #19890. The content of ifchanged template tag was rendered twice.""" - template = Template('{% load cycle from future %}{% ifchanged %}{% cycle "1st time" "2nd time" %}{% endifchanged %}') + template = Template('{% ifchanged %}{% cycle "1st time" "2nd time" %}{% endifchanged %}') output = template.render(Context({})) self.assertEqual(output, '1st time') @@ -595,6 +595,8 @@ class TemplateTests(TestCase): with warnings.catch_warnings(): # Ignore pending deprecations of loading 'ssi' and 'url' tags from future. warnings.filterwarnings("ignore", category=RemovedInDjango19Warning, module='django.templatetags.future') + # Ignore deprecations of loading 'cycle' and 'firstof' tags from future. + warnings.filterwarnings("ignore", category=RemovedInDjango20Warning, module="django.templatetags.future") test_template = loader.get_template(name) except ShouldNotExecuteException: failures.append("Template test (Cached='%s', TEMPLATE_STRING_IF_INVALID='%s', TEMPLATE_DEBUG=%s): %s -- FAILED. Template loading invoked method that shouldn't have been invoked." % (is_cached, invalid_str, template_debug, name)) |
