Fixed bug in ResetPasswordView. Fixed #1391.

This commit is contained in:
Norman Jäckel 2015-01-05 23:23:57 +01:00
parent 34b6ca80f3
commit 06919fa543
2 changed files with 7 additions and 0 deletions

View File

@ -253,6 +253,7 @@ class ResetPasswordView(SingleObjectMixin, QuestionView):
def on_clicked_yes(self): def on_clicked_yes(self):
self.get_object().reset_password() self.get_object().reset_password()
self.get_object().save()
def get_final_message(self): def get_final_message(self):
return _('The Password for %s was successfully reset.') % html_strong(self.get_object()) return _('The Password for %s was successfully reset.') % html_strong(self.get_object())

View File

@ -57,6 +57,12 @@ class UserViews(TestCase):
response = self.client.get('/user/1/status/activate/') response = self.client.get('/user/1/status/activate/')
self.assertEqual(response.status_code, 302) self.assertEqual(response.status_code, 302)
def test_reset_password(self):
self.admin.default_password = new_password = 'password_ohweleeh1Shee5wibo1I'
self.admin.save()
self.client.post('/user/1/reset_password/', {'yes': 'yes'})
self.assertTrue(self.client.login(username='admin', password=new_password))
class GroupViews(TestCase): class GroupViews(TestCase):
""" """