Fixed bug in ResetPasswordView. Fixed #1391.
This commit is contained in:
parent
34b6ca80f3
commit
06919fa543
@ -253,6 +253,7 @@ class ResetPasswordView(SingleObjectMixin, QuestionView):
|
||||
|
||||
def on_clicked_yes(self):
|
||||
self.get_object().reset_password()
|
||||
self.get_object().save()
|
||||
|
||||
def get_final_message(self):
|
||||
return _('The Password for %s was successfully reset.') % html_strong(self.get_object())
|
||||
|
@ -57,6 +57,12 @@ class UserViews(TestCase):
|
||||
response = self.client.get('/user/1/status/activate/')
|
||||
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):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user