Skip to content
Myr

- Testcase

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Richard Eames · committed by Richard Eames · parent 846bdc1 · Browse files · 1 file+13 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+13 added−1 removed

  • other:+13 added−1 removed

1 file+13 added−1 removed

modified:jinja2/testsuite/regression.py+13 added-1 removed
244 unmodified lines
245 except TemplateNotFound, e:246 assert e.name == 'foo/bar.html'247 else:248 assert False, 'expected error here'249 250 def test_contextfunction_callable_classes(self):251 from jinja2.utils import contextfunction252 class CallableClass(object):253 @contextfunction254 def __call__(self, ctx):255 return ctx.resolve('hello')256 257 tpl = Template("""{{ callableclass() }}""")258 output = tpl.render(callableclass = CallableClass(), hello = 'TEST')259 expected = 'TEST'260 261 self.assert_equal(output, expected)262250263def suite():264 suite = unittest.TestSuite()265 suite.addTest(unittest.makeSuite(CornerTestCase))266 suite.addTest(unittest.makeSuite(BugTestCase))
1 unmodified line