diff --git a/django/contrib/admin/templates/admin/auth/user/change_password.html b/django/contrib/admin/templates/admin/auth/user/change_password.html index 3f13be2b5c..ee4dc6d08d 100644 --- a/django/contrib/admin/templates/admin/auth/user/change_password.html +++ b/django/contrib/admin/templates/admin/auth/user/change_password.html @@ -20,6 +20,7 @@ {% endif %} {% block content %}
{% csrf_token %}{% block form_top %}{% endblock %} +
{% if is_popup %}{% endif %} {% if form.errors %} diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index e706ba7105..ddd050e746 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -958,15 +958,18 @@ class AdminCustomTemplateTests(AdminViewBasicTestCase): response = self.client.get(reverse('admin:admin_views_section_add')) self.assertContains(response, 'bodyclass_consistency_check ') - def test_extended_bodyclass_template_change_password(self): - """ - Ensure that the auth/user/change_password.html template uses block - super in the bodyclass block. - """ + def test_change_password_template(self): user = User.objects.get(username='super') response = self.client.get(reverse('admin:auth_user_password_change', args=(user.id,))) + # The auth/user/change_password.html template uses super in the + # bodyclass block. self.assertContains(response, 'bodyclass_consistency_check ') + # When a site has multiple passwords in the browser's password manager, + # a browser pop up asks which user the new password is for. To prevent + # this, the username is added to the change password form. + self.assertContains(response, '') + def test_extended_bodyclass_template_index(self): """ Ensure that the admin/index.html template uses block.super in the