mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
Fixed #31865 -- Adjusted admin nav sidebar template to reduce debug logging.
Thanks to Mariusz Felisiak for review.
This commit is contained in:
parent
8a5683b6b2
commit
0aeb802cf0
@ -1,5 +1,5 @@
|
||||
{% load i18n %}
|
||||
<button class="sticky toggle-nav-sidebar" id="toggle-nav-sidebar" aria-label="{% translate 'Toggle navigation' %}"></button>
|
||||
<nav class="sticky" id="nav-sidebar">
|
||||
{% include 'admin/app_list.html' with app_list=available_apps %}
|
||||
{% include 'admin/app_list.html' with app_list=available_apps show_changelinks=False %}
|
||||
</nav>
|
||||
|
@ -17,3 +17,6 @@ Bugfixes
|
||||
|
||||
* Fixed encoding session data while upgrading multiple instances of the same
|
||||
project to Django 3.1 (:ticket:`31864`).
|
||||
|
||||
* Adjusted admin's navigation sidebar template to reduce debug logging when
|
||||
rendering (:ticket:`31865`).
|
||||
|
@ -77,6 +77,14 @@ class AdminSidebarTests(TestCase):
|
||||
self.assertContains(response, '<a href="%s">Users</a>' % url)
|
||||
self.assertNotContains(response, 'aria-current')
|
||||
|
||||
@override_settings(DEBUG=True)
|
||||
def test_included_app_list_template_context_fully_set(self):
|
||||
# All context variables should be set when rendering the sidebar.
|
||||
url = reverse('test_with_sidebar:auth_user_changelist')
|
||||
with self.assertRaisesMessage(AssertionError, 'no logs'):
|
||||
with self.assertLogs('django.template', 'DEBUG'):
|
||||
self.client.get(url)
|
||||
|
||||
|
||||
@override_settings(ROOT_URLCONF='admin_views.test_nav_sidebar')
|
||||
class SeleniumTests(AdminSeleniumTestCase):
|
||||
|
Loading…
Reference in New Issue
Block a user