Hi,

I've written a custom inclusion tag for a project of mine. The problem
is: how can i test it? I've got a TestCase which has some methods:

    def get_tagcloud_template(self, argument):
        return """{%% load taggit_extras %%}
                  {%% include_tagcloud %s %%}
        """ % argument

My approach for testing template-tags was:

    def test_taglist_project(self):
        t = Template(self.get_taglist_template(""))
        c = Context({})
        t.render(c)

and then I tested the members of `c`, for example

self.assertEquals(c.get('tags'), ['somelist'])

But the template-variables exist only in the scope of the included
template, not in the template that contains the include-statement. How
do I test if everything's working? Do I have to read the file that
contains the include-statement and render it?

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

Reply via email to