def render_mustache(template_name, dictionary, *args, **kwargs): template = middleware.lookup['main'].get_template(template_name).source return pystache.render(template, dictionary)
def test(): actual = pystache_custom.render(template, context) if actual != expected: raise Exception("Benchmark mismatch: \n%s\n*** != ***\n%s" % (expected, actual))
def render_mustache(template_name, dictionary, *args, **kwargs): template = lookup_template('main', template_name).source return pystache.render(template, dictionary)
def render_mustache(template_name, dictionary, *args, **kwargs): template = edxmako.lookup['main'].get_template(template_name).source return pystache.render(template, dictionary)
def test_comments(self): template = "What {{! the }} what?" actual = pystache_custom.render(template) self.assertEqual("What what?", actual)
def render_mustache(template_name, dictionary, *args, **kwargs): template = middleware.lookup["main"].get_template(template_name).source return pystache.render(template, dictionary)
def test_basic(self): ret = pystache_custom.render("Hi {{thing}}!", { 'thing': 'world' }) self.assertEqual(ret, "Hi world!")
def test_kwargs(self): ret = pystache_custom.render("Hi {{thing}}!", thing='world') self.assertEqual(ret, "Hi world!")
def _assert_rendered(self, expected, template, context): actual = pystache_custom.render(template, context) self.assertEqual(actual, expected)
def test_basic(self): ret = pystache_custom.render("Hi {{thing}}!", {'thing': 'world'}) self.assertEqual(ret, "Hi world!")