Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#1217 closed defect (fixed)

[patch] Additional unit tests for default template tags

Reported by: nick@… Owned by: adrian
Component: Template system Version: magic-removal
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


This patch, against rev 1941 of magic-removal, adds missing unit tests to tests/othertests/ for tags cycle, filter, firstof, ifchanged, regroup, templatetag and widthratio. Tags debug, now and ssi still don't have tests, as I'm not too clear on how best to implement them. Any thoughts?...

There is one issue relating to cycle that needs clarification. It seems that {% cycle foo %} is interpreted as a repeat occurrence of a cycle previously named foo. If there is no cycle named foo then I would expect this usage to yield a TemplateSyntaxError, but in fact we see AttributeError: 'Parser' object has no attribute '_namedCycleNodes'. Is this a bug, perhaps?

Attachments (1)

templates.diff (9.8 KB) - added by nick@… 11 years ago.
[patch] Additional unit tests for default template tags

Download all attachments as: .zip

Change History (3)

Changed 11 years ago by nick@…

[patch] Additional unit tests for default template tags

comment:1 Changed 11 years ago by adrian

Nice tests! Thanks very much.

comment:2 Changed 11 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

(In [1944]) magic-removal: Fixed #1217 -- Added some template-tag unit tests. Thanks, nick at

Note: See TracTickets for help on using tickets.
Back to Top