Commit 220b3cd8 by Chris Jerdonek

Fixed issue #50: "Template(foo='bar') raises an exception"

The commit also adds a unit test for this case.
parent 1931b7d9
......@@ -66,6 +66,9 @@ class Template(object):
self.template = template
if context is None:
context = {}
if kwargs:
context.update(kwargs)
......
# coding: utf-8
"""
Unit tests of template.py.
"""
import unittest
from pystache.template import Template
class TemplateTestCase(unittest.TestCase):
def test_init__kwargs_with_no_context(self):
"""
Test passing **kwargs with no context.
"""
# This test checks that the following line raises no exception.
template = Template(foo="bar")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment