Commit 4720fa7f by Chris Jerdonek

Starting branch for the View class to load templates using a Renderer.

parent 137fd4f2
......@@ -49,7 +49,7 @@ class Renderer(object):
the method should either return None (as dict.get() does) or
raise an exception.
Defaults to constructing a default Loader, but using the
default_encoding and decode_errors arguments.
file_encoding and decode_errors arguments.
escape: the function used to escape variable tag values when
rendering a template. The function should accept a unicode
......@@ -94,7 +94,7 @@ class Renderer(object):
escape = lambda s: cgi.escape(s, quote=True)
if loader is None:
reader = Reader(encoding=default_encoding, decode_errors=decode_errors)
reader = Reader(encoding=file_encoding, decode_errors=decode_errors)
loader = Loader(reader=reader)
self.decode_errors = decode_errors
......
......@@ -46,12 +46,12 @@ class RendererInitTestCase(unittest.TestCase):
self.assertEquals(actual.search_dirs, expected.search_dirs)
self.assertEquals(actual.reader.__dict__, expected.reader.__dict__)
def test_loader__default__default_encoding(self):
def test_loader__default__encoding(self):
"""
Test that the default loader inherits default_encoding.
Test that the default loader inherits the correct encoding.
"""
renderer = Renderer(default_encoding='foo')
renderer = Renderer(file_encoding='foo')
reader = renderer.loader.reader
self.assertEquals(reader.encoding, 'foo')
......
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