mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #27359 -- Made Engine.get_default() return the first DjangoTemplates engine if multiple are defined.
This commit is contained in:
committed by
Tim Graham
parent
7019724101
commit
6b3724fa11
@@ -41,14 +41,14 @@ class GetDefaultTests(SimpleTestCase):
|
||||
@override_settings(TEMPLATES=[{
|
||||
'NAME': 'default',
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'OPTIONS': {'file_charset': 'abc'},
|
||||
}, {
|
||||
'NAME': 'other',
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'OPTIONS': {'file_charset': 'def'},
|
||||
}])
|
||||
def test_multiple_engines_configured(self):
|
||||
msg = 'Several DjangoTemplates backends are configured. You must select one explicitly.'
|
||||
with self.assertRaisesMessage(ImproperlyConfigured, msg):
|
||||
Engine.get_default()
|
||||
self.assertEqual(Engine.get_default().file_charset, 'abc')
|
||||
|
||||
|
||||
class LoaderTests(SimpleTestCase):
|
||||
|
||||
Reference in New Issue
Block a user