Commit 08b5173c by Chris Jerdonek

Renamed custom_template.Loader.get_template() to custom_template.Loader.load().

parent 8431c10e
......@@ -173,14 +173,20 @@ class Loader(object):
return path
def get_template(self, view):
def load(self, custom):
"""
Return the unicode template string associated with a view.
Find and return the template associated to a CustomizedTemplate instance.
Returns the template as a unicode string.
Arguments:
custom: a CustomizedTemplate instance.
"""
if view.template is not None:
return self.reader.unicode(view.template, view.template_encoding)
if custom.template is not None:
return self.reader.unicode(custom.template, custom.template_encoding)
path = self.get_template_path(view)
path = self.get_template_path(custom)
return self.reader.read(path, view.template_encoding)
return self.reader.read(path, custom.template_encoding)
......@@ -236,9 +236,9 @@ class LoaderTests(unittest.TestCase, AssertIsMixin):
self.assertEquals(actual, expected)
def _assert_get_template(self, view, expected):
def _assert_get_template(self, custom, expected):
locator = self._make_locator()
actual = locator.get_template(view)
actual = locator.load(custom)
self.assertEquals(type(actual), unicode)
self.assertEquals(actual, expected)
......
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