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