mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Refs #22306 -- Removed cycle/firstof template tags from "future".
Per deprecation timeline.
This commit is contained in:
parent
c64dd646f5
commit
57039f9661
3 changed files with 8 additions and 86 deletions
|
@ -1,12 +1,10 @@
|
|||
from django.template import TemplateSyntaxError
|
||||
from django.test import SimpleTestCase, ignore_warnings
|
||||
from django.utils.deprecation import RemovedInDjango110Warning
|
||||
from django.test import SimpleTestCase
|
||||
|
||||
from ..utils import setup
|
||||
|
||||
|
||||
class FirstOfTagTests(SimpleTestCase):
|
||||
libraries = {'future': 'django.templatetags.future'}
|
||||
|
||||
@setup({'firstof01': '{% firstof a b c %}'})
|
||||
def test_firstof01(self):
|
||||
|
@ -58,27 +56,22 @@ class FirstOfTagTests(SimpleTestCase):
|
|||
output = self.engine.render_to_string('firstof10', {'a': '<'})
|
||||
self.assertEqual(output, '<')
|
||||
|
||||
@ignore_warnings(category=RemovedInDjango110Warning)
|
||||
@setup({'firstof11': '{% load firstof from future %}{% firstof a b %}'})
|
||||
@setup({'firstof11': '{% firstof a b %}'})
|
||||
def test_firstof11(self):
|
||||
output = self.engine.render_to_string('firstof11', {'a': '<', 'b': '>'})
|
||||
self.assertEqual(output, '<')
|
||||
|
||||
@ignore_warnings(category=RemovedInDjango110Warning)
|
||||
@setup({'firstof12': '{% load firstof from future %}{% firstof a b %}'})
|
||||
@setup({'firstof12': '{% firstof a b %}'})
|
||||
def test_firstof12(self):
|
||||
output = self.engine.render_to_string('firstof12', {'a': '', 'b': '>'})
|
||||
self.assertEqual(output, '>')
|
||||
|
||||
@ignore_warnings(category=RemovedInDjango110Warning)
|
||||
@setup({'firstof13': '{% load firstof from future %}'
|
||||
'{% autoescape off %}{% firstof a %}{% endautoescape %}'})
|
||||
@setup({'firstof13': '{% autoescape off %}{% firstof a %}{% endautoescape %}'})
|
||||
def test_firstof13(self):
|
||||
output = self.engine.render_to_string('firstof13', {'a': '<'})
|
||||
self.assertEqual(output, '<')
|
||||
|
||||
@ignore_warnings(category=RemovedInDjango110Warning)
|
||||
@setup({'firstof14': '{% load firstof from future %}{% firstof a|safe b %}'})
|
||||
@setup({'firstof14': '{% firstof a|safe b %}'})
|
||||
def test_firstof14(self):
|
||||
output = self.engine.render_to_string('firstof14', {'a': '<'})
|
||||
self.assertEqual(output, '<')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue