mitsuhiko/jinja2 — pull request #200 by Naddiseo (2013-04-16 05:52:52+00:00)
Title: Callable class contextfunction

If a class is callable and is set to have the context passed to it, jinja will not currently obey. This patch adds the following test, and a fix for it.

```python
from jinja2 import Template
from jinja2.utils import contextfunction

class CallableClass(object):
@contextfunction
def __call__(self, ctx):
return ctx.resolve('hello')

tpl = Template("""{{ callableclass() }}""")
output = tpl.render(callableclass = CallableClass(), hello = 'TEST')
expected = 'TEST'

assert output == expected
```