summaryrefslogtreecommitdiff
path: root/tests/template_tests/test_loaders.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2014-11-27 21:39:33 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2014-12-28 16:23:01 +0100
commit5523e4cdbb786c396c103cfab369fc2ef8d6c52a (patch)
tree9efe63f1c5fd9cb4002879c868e4c52d1e9e46cd /tests/template_tests/test_loaders.py
parent4ea43ac915e187fb0c283094504f488d5017d7ec (diff)
Removed private API find_template.
It wasn't documented and it wasn't used anywhere, except in a few tests that don't test it specifically and can be rewritten with get_template.
Diffstat (limited to 'tests/template_tests/test_loaders.py')
-rw-r--r--tests/template_tests/test_loaders.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/template_tests/test_loaders.py b/tests/template_tests/test_loaders.py
index 4a6635f08f..f068d8b71a 100644
--- a/tests/template_tests/test_loaders.py
+++ b/tests/template_tests/test_loaders.py
@@ -114,10 +114,12 @@ class EggLoaderTest(SimpleTestCase):
class CachedLoader(SimpleTestCase):
def test_templatedir_caching(self):
"Check that the template directories form part of the template cache key. Refs #13573"
+ template_loader = Engine.get_default().template_loaders[0]
+
# Retrieve a template specifying a template directory to check
- t1, name = loader.find_template('test.html', (os.path.join(os.path.dirname(upath(__file__)), 'templates', 'first'),))
+ t1, name = template_loader.find_template('test.html', (os.path.join(os.path.dirname(upath(__file__)), 'templates', 'first'),))
# Now retrieve the same template name, but from a different directory
- t2, name = loader.find_template('test.html', (os.path.join(os.path.dirname(upath(__file__)), 'templates', 'second'),))
+ t2, name = template_loader.find_template('test.html', (os.path.join(os.path.dirname(upath(__file__)), 'templates', 'second'),))
# The two templates should not have the same content
self.assertNotEqual(t1.render(Context({})), t2.render(Context({})))
@@ -215,7 +217,7 @@ class PriorityCacheLoader(SimpleTestCase):
"""
Check that the order of template loader works. Refs #21460.
"""
- t1, name = loader.find_template('priority/foo.html')
+ t1 = loader.get_template('priority/foo.html')
self.assertEqual(t1.render(Context({})), 'priority\n')
@@ -228,5 +230,5 @@ class PriorityLoader(SimpleTestCase):
"""
Check that the order of template loader works. Refs #21460.
"""
- t1, name = loader.find_template('priority/foo.html')
+ t1 = loader.get_template('priority/foo.html')
self.assertEqual(t1.render(Context({})), 'priority\n')