1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

Fixed #27359 -- Made Engine.get_default() return the first DjangoTemplates engine if multiple are defined.

This commit is contained in:
Carlton Gibson
2017-03-10 21:46:37 +01:00
committed by Tim Graham
parent 7019724101
commit 6b3724fa11
5 changed files with 27 additions and 25 deletions

View File

@@ -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):