Exemplo n.º 1
0
 def test_template_loader_skips_non_django_backends(self):
     template_setting = [{
         'BACKEND': 'nondjango.templates',
         'OPTIONS': {'loaders': [('nondjango.templates.Loader',)]},
     }]
     with override_settings(TEMPLATES=template_setting):
         errors = checks.check_cached_template_loader_used()
         self.assertEqual(len(errors), 0)
Exemplo n.º 2
0
 def test_template_loader_skips_non_django_backends(self):
     template_setting = [{
         'BACKEND': 'nondjango.templates',
         'OPTIONS': {'loaders': [('nondjango.templates.Loader',)]},
     }]
     with override_settings(TEMPLATES=template_setting):
         errors = checks.check_cached_template_loader_used()
         self.assertEqual(len(errors), 0)
Exemplo n.º 3
0
 def test_template_loader_missing(self):
     template_setting = [{
         'BACKEND': 'django.template.backends.django.DjangoTemplates',
         'OPTIONS': {'loaders': [('django.template.loaders.filesystem.Loader',)]},
     }]
     with override_settings(TEMPLATES=template_setting):
         errors = checks.check_cached_template_loader_used()
         self.assertEqual(len(errors), 1)
         self.assertEqual(errors[0].id, 'djangae.E003')
Exemplo n.º 4
0
 def test_template_loader_missing(self):
     template_setting = [{
         'BACKEND': 'django.template.backends.django.DjangoTemplates',
         'OPTIONS': {'loaders': [('django.template.loaders.filesystem.Loader',)]},
     }]
     with override_settings(TEMPLATES=template_setting):
         errors = checks.check_cached_template_loader_used()
         self.assertEqual(len(errors), 1)
         self.assertEqual(errors[0].id, 'djangae.E003')
Exemplo n.º 5
0
 def test_template_loader_present(self):
     template_setting = [{
         'BACKEND': 'django.template.backends.django.DjangoTemplates',
         'OPTIONS': {'loaders': [
             ('django.template.loaders.cached.Loader', ('django.template.loaders.filesystem.Loader',)),
         ]},
     }]
     with override_settings(TEMPLATES=template_setting):
         errors = checks.check_cached_template_loader_used()
         self.assertEqual(len(errors), 0)
Exemplo n.º 6
0
 def test_template_loader_present(self):
     template_setting = [{
         'BACKEND': 'django.template.backends.django.DjangoTemplates',
         'OPTIONS': {'loaders': [
             ('django.template.loaders.cached.Loader', ('django.template.loaders.filesystem.Loader',)),
         ]},
     }]
     with override_settings(TEMPLATES=template_setting):
         errors = checks.check_cached_template_loader_used()
         self.assertEqual(len(errors), 0)