summaryrefslogtreecommitdiff
path: root/tests/template_tests/syntax_tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-03-05 12:38:42 -0500
committerTim Graham <timograham@gmail.com>2015-03-07 07:42:39 -0500
commitc36b60836be9e78ab877566cc43dc03960ce944d (patch)
tree9c7dde39c5d44e3db51707bf23d391827e17ba7a /tests/template_tests/syntax_tests
parent88c605e3e34cebd5485d286a17ac84c7b8b0faf1 (diff)
Fixed #24451 -- Deprecated comma-separated {% cycle %} syntax.
Diffstat (limited to 'tests/template_tests/syntax_tests')
-rw-r--r--tests/template_tests/syntax_tests/test_cycle.py6
-rw-r--r--tests/template_tests/syntax_tests/test_if_changed.py4
2 files changed, 8 insertions, 2 deletions
diff --git a/tests/template_tests/syntax_tests/test_cycle.py b/tests/template_tests/syntax_tests/test_cycle.py
index 88a7187b1a..e2edf94c8d 100644
--- a/tests/template_tests/syntax_tests/test_cycle.py
+++ b/tests/template_tests/syntax_tests/test_cycle.py
@@ -12,16 +12,19 @@ class CycleTagTests(SimpleTestCase):
with self.assertRaises(TemplateSyntaxError):
self.engine.get_template('cycle01')
+ @ignore_warnings(category=RemovedInDjango20Warning)
@setup({'cycle02': '{% cycle a,b,c as abc %}{% cycle abc %}'})
def test_cycle02(self):
output = self.engine.render_to_string('cycle02')
self.assertEqual(output, 'ab')
+ @ignore_warnings(category=RemovedInDjango20Warning)
@setup({'cycle03': '{% cycle a,b,c as abc %}{% cycle abc %}{% cycle abc %}'})
def test_cycle03(self):
output = self.engine.render_to_string('cycle03')
self.assertEqual(output, 'abc')
+ @ignore_warnings(category=RemovedInDjango20Warning)
@setup({'cycle04': '{% cycle a,b,c as abc %}{% cycle abc %}{% cycle abc %}{% cycle abc %}'})
def test_cycle04(self):
output = self.engine.render_to_string('cycle04')
@@ -37,16 +40,19 @@ class CycleTagTests(SimpleTestCase):
with self.assertRaises(TemplateSyntaxError):
self.engine.get_template('cycle06')
+ @ignore_warnings(category=RemovedInDjango20Warning)
@setup({'cycle07': '{% cycle a,b,c as foo %}{% cycle bar %}'})
def test_cycle07(self):
with self.assertRaises(TemplateSyntaxError):
self.engine.get_template('cycle07')
+ @ignore_warnings(category=RemovedInDjango20Warning)
@setup({'cycle08': '{% cycle a,b,c as foo %}{% cycle foo %}{{ foo }}{{ foo }}{% cycle foo %}{{ foo }}'})
def test_cycle08(self):
output = self.engine.render_to_string('cycle08')
self.assertEqual(output, 'abbbcc')
+ @ignore_warnings(category=RemovedInDjango20Warning)
@setup({'cycle09': '{% for i in test %}{% cycle a,b %}{{ i }},{% endfor %}'})
def test_cycle09(self):
output = self.engine.render_to_string('cycle09', {'test': list(range(5))})
diff --git a/tests/template_tests/syntax_tests/test_if_changed.py b/tests/template_tests/syntax_tests/test_if_changed.py
index 33e66880dd..b06c0bbdd9 100644
--- a/tests/template_tests/syntax_tests/test_if_changed.py
+++ b/tests/template_tests/syntax_tests/test_if_changed.py
@@ -124,14 +124,14 @@ class IfChangedTagTests(SimpleTestCase):
self.assertEqual(output, '1-first,1-other,2-first,2-other,2-other,3-first,')
@setup({'ifchanged-else02': '{% for id in ids %}{{ id }}-'
- '{% ifchanged id %}{% cycle red,blue %}{% else %}grey{% endifchanged %}'
+ '{% ifchanged id %}{% cycle "red" "blue" %}{% else %}grey{% endifchanged %}'
',{% endfor %}'})
def test_ifchanged_else02(self):
output = self.engine.render_to_string('ifchanged-else02', {'ids': [1, 1, 2, 2, 2, 3]})
self.assertEqual(output, '1-red,1-grey,2-blue,2-grey,2-grey,3-red,')
@setup({'ifchanged-else03': '{% for id in ids %}{{ id }}'
- '{% ifchanged id %}-{% cycle red,blue %}{% else %}{% endifchanged %}'
+ '{% ifchanged id %}-{% cycle "red" "blue" %}{% else %}{% endifchanged %}'
',{% endfor %}'})
def test_ifchanged_else03(self):
output = self.engine.render_to_string('ifchanged-else03', {'ids': [1, 1, 2, 2, 2, 3]})