aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_htmlrenderer.py
diff options
context:
space:
mode:
authorTom Christie2015-01-23 11:47:01 +0000
committerTom Christie2015-01-23 11:47:01 +0000
commite988d578535fcc820d30dc7c59f1e24f5c911d3c (patch)
tree92f75aa27d03172661339af787786e201ccbb5fd /tests/test_htmlrenderer.py
parente307fd289c52a9bb97a567cff314a479bbdd21df (diff)
downloaddjango-rest-framework-e988d578535fcc820d30dc7c59f1e24f5c911d3c.tar.bz2
Fix template loader monkey patching to also support 1.8
Diffstat (limited to 'tests/test_htmlrenderer.py')
-rw-r--r--tests/test_htmlrenderer.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_htmlrenderer.py b/tests/test_htmlrenderer.py
index 2edc6b4b..a33b832f 100644
--- a/tests/test_htmlrenderer.py
+++ b/tests/test_htmlrenderer.py
@@ -56,7 +56,13 @@ class TemplateHTMLRendererTests(TestCase):
return Template("example: {{ object }}")
raise TemplateDoesNotExist(template_name)
+ def select_template(template_name_list, dirs=None, using=None):
+ if template_name_list == ['example.html']:
+ return Template("example: {{ object }}")
+ raise TemplateDoesNotExist(template_name_list[0])
+
django.template.loader.get_template = get_template
+ django.template.loader.select_template = select_template
def tearDown(self):
"""