コード例 #1
0
ファイル: utils.py プロジェクト: hughdbrown/edx-platform
def render_mustache(template_name, dictionary, *args, **kwargs):
    template = middleware.lookup['main'].get_template(template_name).source
    return pystache.render(template, dictionary)
コード例 #2
0
 def test():
     actual = pystache_custom.render(template, context)
     if actual != expected:
         raise Exception("Benchmark mismatch: \n%s\n*** != ***\n%s" % (expected, actual))
コード例 #3
0
ファイル: utils.py プロジェクト: dmitchell/edx-platform
def render_mustache(template_name, dictionary, *args, **kwargs):
    template = lookup_template('main', template_name).source
    return pystache.render(template, dictionary)
コード例 #4
0
ファイル: utils.py プロジェクト: 6thfdwp/edx-platform
def render_mustache(template_name, dictionary, *args, **kwargs):
    template = edxmako.lookup['main'].get_template(template_name).source
    return pystache.render(template, dictionary)
コード例 #5
0
ファイル: benchmark.py プロジェクト: GbalsaC/bitnamiP
 def test():
     actual = pystache_custom.render(template, context)
     if actual != expected:
         raise Exception("Benchmark mismatch: \n%s\n*** != ***\n%s" % (expected, actual))
コード例 #6
0
def render_mustache(template_name, dictionary, *args, **kwargs):
    template = lookup_template('main', template_name).source
    return pystache.render(template, dictionary)
コード例 #7
0
ファイル: test_pystache.py プロジェクト: GbalsaC/bitnamiP
 def test_comments(self):
     template = "What {{! the }} what?"
     actual = pystache_custom.render(template)
     self.assertEqual("What  what?", actual)
コード例 #8
0
ファイル: utils.py プロジェクト: hanwentao/edx-platform
def render_mustache(template_name, dictionary, *args, **kwargs):
    template = middleware.lookup["main"].get_template(template_name).source
    return pystache.render(template, dictionary)
コード例 #9
0
ファイル: test_pystache.py プロジェクト: GbalsaC/bitnamiP
 def test_basic(self):
     ret = pystache_custom.render("Hi {{thing}}!", { 'thing': 'world' })
     self.assertEqual(ret, "Hi world!")
コード例 #10
0
ファイル: test_pystache.py プロジェクト: GbalsaC/bitnamiP
 def test_kwargs(self):
     ret = pystache_custom.render("Hi {{thing}}!", thing='world')
     self.assertEqual(ret, "Hi world!")
コード例 #11
0
ファイル: test_pystache.py プロジェクト: GbalsaC/bitnamiP
 def _assert_rendered(self, expected, template, context):
     actual = pystache_custom.render(template, context)
     self.assertEqual(actual, expected)
コード例 #12
0
 def test_comments(self):
     template = "What {{! the }} what?"
     actual = pystache_custom.render(template)
     self.assertEqual("What  what?", actual)
コード例 #13
0
 def test_kwargs(self):
     ret = pystache_custom.render("Hi {{thing}}!", thing='world')
     self.assertEqual(ret, "Hi world!")
コード例 #14
0
 def test_basic(self):
     ret = pystache_custom.render("Hi {{thing}}!", {'thing': 'world'})
     self.assertEqual(ret, "Hi world!")
コード例 #15
0
 def _assert_rendered(self, expected, template, context):
     actual = pystache_custom.render(template, context)
     self.assertEqual(actual, expected)