mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
formatting
This commit is contained in:
parent
b06eeb75dd
commit
9388a4e326
@ -91,5 +91,5 @@ def delete_selected(modeladmin, request, queryset):
|
||||
"admin/delete_selected_confirmation.html",
|
||||
],
|
||||
context,
|
||||
using=modeladmin.admin_site.template_engine
|
||||
using=modeladmin.admin_site.template_engine,
|
||||
)
|
||||
|
@ -573,7 +573,10 @@ class AdminSite:
|
||||
request.current_app = self.name
|
||||
|
||||
return TemplateResponse(
|
||||
request, self.index_template or "admin/index.html", context, using=self.template_engine
|
||||
request,
|
||||
self.index_template or "admin/index.html",
|
||||
context,
|
||||
using=self.template_engine,
|
||||
)
|
||||
|
||||
def app_index(self, request, app_label, extra_context=None):
|
||||
|
@ -1,4 +1,5 @@
|
||||
from django.contrib import admin
|
||||
|
||||
|
||||
class CustomAdminSiteWithCustomTemplateEngine(admin.AdminSite):
|
||||
template_engine = "custom_template_engine"
|
||||
|
@ -128,6 +128,7 @@ class SiteActionsTests(SimpleTestCase):
|
||||
self.site.disable_action(action_name)
|
||||
self.assertEqual(self.site.get_action(action_name), delete_selected)
|
||||
|
||||
|
||||
class AdminSiteCustomTemplateEngineTests(TestCase):
|
||||
request_factory = RequestFactory()
|
||||
|
||||
@ -143,4 +144,7 @@ class AdminSiteCustomTemplateEngineTests(TestCase):
|
||||
request.user = self.user
|
||||
index_response = admin_site.index(request=request)
|
||||
|
||||
self.assertEqual(index_response.using, CustomAdminSiteWithCustomTemplateEngine.template_engine)
|
||||
self.assertEqual(
|
||||
index_response.using,
|
||||
CustomAdminSiteWithCustomTemplateEngine.template_engine,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user