mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #28122 -- Fixed crash when overriding views.static.directory_index()'s template.
This commit is contained in:
@@ -112,6 +112,20 @@ class StaticTests(SimpleTestCase):
|
||||
response = self.client.get('/%s/' % self.prefix)
|
||||
self.assertContains(response, 'Index of ./')
|
||||
|
||||
@override_settings(TEMPLATES=[{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'OPTIONS': {
|
||||
'loaders': [
|
||||
('django.template.loaders.locmem.Loader', {
|
||||
'static/directory_index.html': 'Test index',
|
||||
}),
|
||||
],
|
||||
},
|
||||
}])
|
||||
def test_index_custom_template(self):
|
||||
response = self.client.get('/%s/' % self.prefix)
|
||||
self.assertEqual(response.content, b'Test index')
|
||||
|
||||
|
||||
class StaticHelperTest(StaticTests):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user