From 8c275cd9b8817d0a817ebce853c111d11ceb86e9 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 27 Oct 2013 18:34:06 -0400 Subject: More tests of Templite's sad-path behavior. --- tests/test_templite.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/test_templite.py') diff --git a/tests/test_templite.py b/tests/test_templite.py index e3918e4b..7326d241 100644 --- a/tests/test_templite.py +++ b/tests/test_templite.py @@ -39,6 +39,14 @@ class TempliteTest(CoverageTest): # Variables use {{var}} syntax. self.try_render("Hello, {{name}}!", {'name':'Ned'}, "Hello, Ned!") + def test_undefined_variables(self): + # Using undefined names is an error. + self.assertRaises( + Exception, + self.try_render, + "Hi, {{name}}!", {}, "xyz" + ) + def test_pipes(self): # Variables can be filtered with pipes. data = { -- cgit v1.2.1