'Failing to initialize a backend keeps raising the original exception
(#24265).'

@override_settings(TEMPLATES=[{'BACKEND': 'django.template.backends.django.DjangoTemplates', 'APP_DIRS': True, 'OPTIONS': {'loaders': []}}])
def test_backend_improperly_configured(self):

    msg = 'app_dirs    must    not    be    set    when    loaders    is    defined.'
    with self.assertRaisesMessage(ImproperlyConfigured, msg):
        engines.all()
    with self.assertRaisesMessage(ImproperlyConfigured, msg):
        engines.all()
