@@ -112,6 +112,7 @@ class TemplateCoverageLoader(BaseLoader):
112112 is_usable = True
113113
114114 def load_template_source (self , template_name , dirs ):
115+ global template_coverage_collection , loaded_templates
115116 if template_coverage_collection == True :
116117 loaded_templates .add (str (template_name ))
117118 raise TemplateDoesNotExist
@@ -159,7 +160,7 @@ def get_template_paths(apps=None):
159160 # TODO: Add app templates to the full list, if we are using
160161 # django.template.loaders.app_directories.Loader
161162 templates = set ()
162- templatepaths = settings .TEMPLATE_DIRS
163+ templatepaths = settings .TEMPLATES [ 0 ][ 'DIRS' ]
163164 for templatepath in templatepaths :
164165 for dirpath , dirs , files in os .walk (templatepath ):
165166 if ".svn" in dirs :
@@ -395,7 +396,7 @@ def setup_test_environment(self, **kwargs):
395396 },
396397 }
397398
398- settings .TEMPLATE_LOADERS = ('ietf.utils.test_runner.TemplateCoverageLoader' ,) + settings .TEMPLATE_LOADERS
399+ settings .TEMPLATES [ 0 ][ 'OPTIONS' ][ 'loaders' ] = ('ietf.utils.test_runner.TemplateCoverageLoader' ,) + settings .TEMPLATES [ 0 ][ 'OPTIONS' ][ 'loaders' ]
399400 template_coverage_collection = True
400401
401402 settings .MIDDLEWARE_CLASSES = ('ietf.utils.test_runner.RecordUrlsMiddleware' ,) + settings .MIDDLEWARE_CLASSES
@@ -412,9 +413,9 @@ def setup_test_environment(self, **kwargs):
412413 print " Changing SITE_ID to '1' during testing."
413414 settings .SITE_ID = 1
414415
415- if settings .TEMPLATE_STRING_IF_INVALID != '' :
416- print " Changing TEMPLATE_STRING_IF_INVALID to '' during testing."
417- settings .TEMPLATE_STRING_IF_INVALID = ''
416+ if settings .TEMPLATES [ 0 ][ 'OPTIONS' ][ 'string_if_invalid' ] != '' :
417+ print ( " Changing settings.TEMPLATES[0]['OPTIONS']['string_if_invalid'] to '' during testing" )
418+ settings .TEMPLATES [ 0 ][ 'OPTIONS' ][ 'string_if_invalid' ] = ''
418419
419420 assert not settings .IDTRACKER_BASE_URL .endswith ('/' )
420421
0 commit comments