Show an error if a user tries to change their password and its the same as before. Fixes #160

This commit is contained in:
Matt Wright
2013-10-16 11:15:17 -04:00
parent b1ac2598c0
commit 9999325ffb
3 changed files with 15 additions and 1 deletions
+10
View File
@@ -474,6 +474,16 @@ class ChangePasswordTest(SecurityTest):
self.assertNotIn('You successfully changed your password', r.data)
self.assertIn('Password must be at least 6 characters', r.data)
def test_change_password_same_as_previous(self):
self.authenticate()
r = self._post('/change', data={
'password': 'password',
'new_password': 'password',
'new_password_confirm': 'password'
}, follow_redirects=True)
self.assertNotIn('You successfully changed your password', r.data)
self.assertIn('Your new password must be different than your previous password.', r.data)
def test_change_password_success(self):
data = {
'password': 'password',