Django

Code

Ticket #1217 (closed: fixed)

Opened 4 years ago

Last modified 3 years ago

[patch] Additional unit tests for default template tags

Reported by: nick@efford.net Assigned to: adrian
Milestone: Component: Template system
Version: magic-removal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

templates.diff (9.8 kB) - added by nick@efford.net on 01/13/06 11:00:50.
[patch] Additional unit tests for default template tags

Change History

01/13/06 11:00:50 changed by nick@efford.net

  • attachment templates.diff added.

[patch] Additional unit tests for default template tags

01/13/06 11:21:42 changed by adrian

Nice tests! Thanks very much.

01/13/06 11:22:44 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #1217 ([patch] Additional unit tests for default template tags)




Change Properties
Action