aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2011-06-05 10:31:29 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2011-06-05 10:31:29 -0500
commit67e8c45d2acba1b58ec2b69a367c3b10d0758c51 (patch)
tree4e0b374d9d57b29d4b551ae6e6632c9ba7623f05
parent99619a625b20d4c5825eeb52753657b088db5381 (diff)
downloadmediagoblin-67e8c45d2acba1b58ec2b69a367c3b10d0758c51.tar.lz
mediagoblin-67e8c45d2acba1b58ec2b69a367c3b10d0758c51.tar.xz
mediagoblin-67e8c45d2acba1b58ec2b69a367c3b10d0758c51.zip
We should store the template path, not the template object, as the key
in our testing cache
-rw-r--r--mediagoblin/util.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mediagoblin/util.py b/mediagoblin/util.py
index 3649b6c3..b675662e 100644
--- a/mediagoblin/util.py
+++ b/mediagoblin/util.py
@@ -94,7 +94,7 @@ def get_jinja_env(template_loader, locale):
TEMPLATE_TEST_CONTEXT = {}
-def render_template(request, template, context):
+def render_template(request, template_path, context):
"""
Render a template with context.
@@ -102,12 +102,12 @@ def render_template(request, template, context):
Also stores the context if we're doing unit tests. Helpful!
"""
template = request.template_env.get_template(
- template)
+ template_path)
context['request'] = request
rendered = template.render(context)
if TESTS_ENABLED:
- TEMPLATE_TEST_CONTEXT[template] = context
+ TEMPLATE_TEST_CONTEXT[template_path] = context
return rendered