def test_change_password(self): """Change password forwards to access""" with patch.object(DummyRequest, "authenticated_userid", new_callable=PropertyMock) as auid: auid.return_value = "u" api.change_password(self.request, "a", "b") self.access.edit_user_password.assert_called_with("u", "b")
def test_change_password_no_verify(self): """ Change password fails if invalid credentials """ self.request.userid = 'u' self.access.verify_user.return_value = False ret = api.change_password(self.request, 'a', 'b') self.assertTrue(isinstance(ret, HTTPForbidden)) self.access.verify_user.assert_called_with('u', 'a')
def test_change_password_no_verify(self): """Change password fails if invalid credentials""" with patch.object(DummyRequest, "authenticated_userid", new_callable=PropertyMock) as auid: auid.return_value = "u" self.access.verify_user.return_value = False ret = api.change_password(self.request, "a", "b") self.assertTrue(isinstance(ret, HTTPForbidden)) self.access.verify_user.assert_called_with("u", "a")
def test_change_password(self): """ Change password forwards to access """ self.request.userid = 'u' api.change_password(self.request, 'a', 'b') self.access.edit_user_password.assert_called_with('u', 'b')
def test_change_password(self): """Change password forwards to access""" self.request.userid = "u" api.change_password(self.request, "a", "b") self.access.edit_user_password.assert_called_with("u", "b")