Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#1217 closed defect (fixed)

[patch] Additional unit tests for default template tags

Reported by: nick@… Owned by: Adrian Holovaty
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: no UI/UX: no

Description

This patch, against rev 1941 of magic-removal, adds missing unit tests to tests/othertests/templates.py 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@… 19 years ago.
[patch] Additional unit tests for default template tags

Download all attachments as: .zip

Change History (3)

by nick@…, 19 years ago

Attachment: templates.diff added

[patch] Additional unit tests for default template tags

comment:1 by Adrian Holovaty, 19 years ago

Nice tests! Thanks very much.

comment:2 by Adrian Holovaty, 19 years ago

Resolution: fixed
Status: newclosed

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

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