@@ -114,10 +114,12 @@ def test_not_installed(self):
114
114
class CachedLoader (SimpleTestCase ):
115
115
def test_templatedir_caching (self ):
116
116
"Check that the template directories form part of the template cache key. Refs #13573"
117
+ template_loader = Engine .get_default ().template_loaders [0 ]
118
+
117
119
# Retrieve a template specifying a template directory to check
118
- t1 , name = loader .find_template ('test.html' , (os .path .join (os .path .dirname (upath (__file__ )), 'templates' , 'first' ),))
120
+ t1 , name = template_loader .find_template ('test.html' , (os .path .join (os .path .dirname (upath (__file__ )), 'templates' , 'first' ),))
119
121
# Now retrieve the same template name, but from a different directory
120
- t2 , name = loader .find_template ('test.html' , (os .path .join (os .path .dirname (upath (__file__ )), 'templates' , 'second' ),))
122
+ t2 , name = template_loader .find_template ('test.html' , (os .path .join (os .path .dirname (upath (__file__ )), 'templates' , 'second' ),))
121
123
122
124
# The two templates should not have the same content
123
125
self .assertNotEqual (t1 .render (Context ({})), t2 .render (Context ({})))
@@ -215,7 +217,7 @@ def test_basic(self):
215
217
"""
216
218
Check that the order of template loader works. Refs #21460.
217
219
"""
218
- t1 , name = loader .find_template ('priority/foo.html' )
220
+ t1 = loader .get_template ('priority/foo.html' )
219
221
self .assertEqual (t1 .render (Context ({})), 'priority\n ' )
220
222
221
223
@@ -228,5 +230,5 @@ def test_basic(self):
228
230
"""
229
231
Check that the order of template loader works. Refs #21460.
230
232
"""
231
- t1 , name = loader .find_template ('priority/foo.html' )
233
+ t1 = loader .get_template ('priority/foo.html' )
232
234
self .assertEqual (t1 .render (Context ({})), 'priority\n ' )
0 commit comments