1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

Merge remote-tracking branch 'django/master' into t3011

This commit is contained in:
Russell Keith-Magee
2012-09-15 14:31:54 +08:00
42 changed files with 195 additions and 356 deletions

View File

@@ -240,23 +240,29 @@ class UserChangeFormTest(TestCase):
# Just check we can create it
form = MyUserForm({})
def test_unsuable_password(self):
user = User.objects.get(username='empty_password')
user.set_unusable_password()
user.save()
form = UserChangeForm(instance=user)
self.assertIn(_("No password set."), form.as_table())
def test_bug_17944_empty_password(self):
user = User.objects.get(username='empty_password')
form = UserChangeForm(instance=user)
# Just check that no error is raised.
form.as_table()
self.assertIn(_("No password set."), form.as_table())
def test_bug_17944_unmanageable_password(self):
user = User.objects.get(username='unmanageable_password')
form = UserChangeForm(instance=user)
# Just check that no error is raised.
form.as_table()
self.assertIn(_("Invalid password format or unknown hashing algorithm."),
form.as_table())
def test_bug_17944_unknown_password_algorithm(self):
user = User.objects.get(username='unknown_password')
form = UserChangeForm(instance=user)
# Just check that no error is raised.
form.as_table()
self.assertIn(_("Invalid password format or unknown hashing algorithm."),
form.as_table())
@skipIfCustomUser