summaryrefslogtreecommitdiff
path: root/tests/admin_views
diff options
context:
space:
mode:
authorOliver Sauder <oliver.sauder@adfinis-sygroup.ch>2016-06-08 17:37:26 +0200
committerTim Graham <timograham@gmail.com>2016-06-09 12:18:15 -0400
commit5d8375fe662f636aff338a70ffa49644f9f53b39 (patch)
tree8314a84272800f27efb35f2781456352cbce3238 /tests/admin_views
parent686a593aaadb1c2e2053fee8c401476dcb4617a5 (diff)
Fixed #4548 -- Added username hint to admin's change_password form.
Diffstat (limited to 'tests/admin_views')
-rw-r--r--tests/admin_views/tests.py13
1 files changed, 8 insertions, 5 deletions
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, '<input type="text" name="username" value="super" style="display: none" />')
+
def test_extended_bodyclass_template_index(self):
"""
Ensure that the admin/index.html template uses block.super in the