mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #28122 -- Fixed crash when overriding views.static.directory_index()'s template.
This commit is contained in:
parent
84dcd16247
commit
56970c5b61
3 changed files with 21 additions and 1 deletions
|
@ -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):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue