#26830: Issue with combination of 'with', 'ifchanged' and 'cycle' templatetags 
in
templates.
---------------------------------+--------------------
     Reporter:  flupzor          |      Owner:  nobody
         Type:  Bug              |     Status:  new
    Component:  Template system  |    Version:  master
     Severity:  Normal           |   Keywords:
 Triage Stage:  Unreviewed       |  Has patch:  0
Easy pickings:  0                |      UI/UX:  0
---------------------------------+--------------------
 I ran into the issue where I do a named cycle in a ifchanged templatetag
 and depending if the given value changes cycle, or do not cycle. This
 works, however, if I put this in a 'with' statement, then it stops
 working.

 I've created two unit tests to show this behavior.

 
https://github.com/flupzor/django/commit/4833c4ea5d0cbfd1e7d1689e1887772856f5aba2

 This is the output of the tests.
 {{{
 $ ./runtests.py template_tests.syntax_tests.test_cycle.CycleTagTests
 Testing against Django installed in '/home/alex/django-repo/django' with
 up to 8 processes
 Creating test database for alias 'default'...
 Creating test database for alias 'other'...
 .......................F.
 ======================================================================
 FAIL: test_cycle29 (template_tests.syntax_tests.test_cycle.CycleTagTests)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/home/alex/django-repo/django/test/utils.py", line 209, in inner
     return func(*args, **kwargs)
   File "/home/alex/django-repo/tests/template_tests/utils.py", line 61, in
 inner
     func(self)
   File "/home/alex/django-
 repo/tests/template_tests/syntax_tests/test_cycle.py", line 144, in
 test_cycle29
     self.assertEqual(output, 'bcabcabcccaa')
 AssertionError: u'bcabcabcaaaa' != 'bcabcabcccaa'

 ----------------------------------------------------------------------
 Ran 25 tests in 0.028s

 FAILED (failures=1)
 Destroying test database for alias 'default'...
 Destroying test database for alias 'other'...
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26830>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.58c81bf76874bb6ed59cc5c1c507636e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to