Merge pull request #1392 from normanjaeckel/Fix1391

Fixed bug in ResetPasswordView. Fixed #1391.
This commit is contained in:
Norman Jäckel 2015-01-06 17:01:26 +01:00
commit 1389ad1d03
2 changed files with 7 additions and 0 deletions

View File

@ -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())

View File

@ -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):
"""