Bump/question for #13956

0 views
Skip to first unread message

Stephen Burrows

unread,
Oct 27, 2010, 11:27:52 AM10/27/10
to django-d...@googlegroups.com
Hi,
A few months ago I posted ticket #13956 regarding indefinite args to simple tags and inclusion tags. There was a short spurt of movement, then not much happened. Now I know more about Django and have time to pursue this. The ticket needs documentation and a few more tests, and I can work on those, if that's all right - I don't know the etiquette for sure.
However, I have two questions:
1. Gregg Müllegger asked in the ticket discussion what should be done about the documentation and was never answered. His question was: "I just reviewed the simple tag documentation and saw that there is no need to change the documentation - there is no mention of the limitation that *args might not be allowed. Or should this be pointed out in the docs?"

2. This may be a silly question, but how would one test an inclusion tag? It would involve including a template... are there test templates that can be included? Would one just use any default django template?

Best,
Stephen

(Original discussion: http://groups.google.com/group/django-developers/browse_thread/thread/abdbe6e563ec8e29)

Łukasz Rekucki

unread,
Oct 27, 2010, 12:40:18 PM10/27/10
to django-d...@googlegroups.com
>
> 2. This may be a silly question, but how would one test an inclusion tag? It
> would involve including a template... are there test templates that can be
> included? Would one just use any default django template?

You probably want to see how {% include %} is tested [1]. The test
case there replaces temporarily the list of template loaders, so that
it doesn't depend on any external resources [2] and restores it to the
previous state after finishing[3]. I'm not sure your tests belong
there, but if you decide to put it somewhere else you could do
something similar.

[1]: http://code.djangoproject.com/browser/django/trunk/tests/regressiontests/templates/tests.py#L918
[2]: http://code.djangoproject.com/browser/django/trunk/tests/regressiontests/templates/tests.py#L333
[3]: http://code.djangoproject.com/browser/django/trunk/tests/regressiontests/templates/tests.py#L415

--
Łukasz Rekucki

Stephen Burrows

unread,
Oct 27, 2010, 5:10:51 PM10/27/10
to Django developers
Thanks for the suggestion. I've added tests for the inclusion tags, so
now everything is being tested that I could think of - with the
exception of inclusion tags that have takes_context=True. Really,
though, they should act the same way from the tag's point of view. The
only difference is that if the first argument of the tag is not called
'context', the tag compilation function should raise a
TemplateSyntaxError. But that happens when the tag is registered, so
it seems like it ought to be tested elsewhere if it isn't already.

Stephen Burrows

unread,
Nov 3, 2010, 11:06:45 AM11/3/10
to Django developers
As far as I know, the only thing still missing from the ticket is a
decision as to whether there need to be documentation changes for
simple tags and inclusion tags... if there need to be changes, I could
try working on them. I would just need to know.
Best,
Stephen

Sean Brant

unread,
Nov 3, 2010, 11:14:30 AM11/3/10
to django-d...@googlegroups.com
Has supporting kwargs along with args been mentioned? I would find
having both very helpful. Maybe we can lean on the work happening for
the include and with tags.

> --
> You received this message because you are subscribed to the Google Groups "Django developers" group.
> To post to this group, send email to django-d...@googlegroups.com.
> To unsubscribe from this group, send email to django-develop...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages