def test_fail_change_to_short_password(self): new_pass = '******' data = { 'login_provider_name': 'local', 'password_action': 'change_password', 'new_password': new_pass, 'new_password_retyped': new_pass } assert(len(new_pass) < const.PASSWORD_MIN_LENGTH) form = LoginForm(data) result = form.is_valid() #print form.errors self.assertFalse(result) self.assertEquals(form.initial['new_password'], None)
def test_fail_change_to_short_password(self): new_pass = '******' data = { 'login_provider_name': 'local', 'password_action': 'change_password', 'new_password': new_pass, 'new_password_retyped': new_pass } assert (len(new_pass) < const.PASSWORD_MIN_LENGTH) form = LoginForm(data) result = form.is_valid() #print form.errors self.assertFalse(result) self.assertEquals(form.initial.get('new_password'), None)