Fixed regression in 4dc4d12e. Refs #21598.

That commit contained a mistake that resulted in the use_cached_loader
option of override_with_test_loader being ignored. As a consequence some
configurations weren't exercised any more by the test suite.
This commit is contained in:
Aymeric Augustin 2014-11-15 18:43:48 +01:00
parent dec93d8991
commit cffa559082
1 changed files with 5 additions and 3 deletions

View File

@ -238,9 +238,11 @@ class override_with_test_loader(override_template_loaders):
@classmethod
def _get_loader(cls, templates_dict, use_cached_loader=False):
if use_cached_loader:
loader = cached.Loader(('TestTemplateLoader',))
loader._cached_loaders = TestTemplateLoader(templates_dict)
return TestTemplateLoader(templates_dict)
loader = cached.Loader(['TestTemplateLoader'])
loader._cached_loaders = [TestTemplateLoader(templates_dict)]
return loader
else:
return TestTemplateLoader(templates_dict)
class override_settings(object):