Exemplo n.º 1
0
 def test_comments(self):
     template = "What {{! the }} what?"
     actual = braces.render(template)
     self.assertEqual("What  what?", actual)
Exemplo n.º 2
0
 def test_kwargs(self):
     ret = braces.render("Hi {{thing}}!", thing='world')
     self.assertEqual(ret, "Hi world!")
Exemplo n.º 3
0
 def _assert_rendered(self, expected, template, context):
     actual = braces.render(template, context)
     self.assertEqual(actual, expected)
Exemplo n.º 4
0
 def test_basic(self):
     ret = braces.render("Hi {{thing}}!", { 'thing': 'world' })
     self.assertEqual(ret, "Hi world!")
Exemplo n.º 5
0
 def test():
     actual = braces.render(template, context)
     if actual != expected:
         raise Exception("Benchmark mismatch: \n%s\n*** != ***\n%s" % (expected, actual))