def test_delete_removes_authclient(self, authclient, matchers, pyramid_request): pyramid_request.db.delete = create_autospec(pyramid_request.db.delete, return_value=None) ctrl = AuthClientEditController(authclient, pyramid_request) ctrl.delete() pyramid_request.db.delete.assert_called_with(authclient)
def test_delete_removes_authclient(self, authclient, matchers, pyramid_request): pyramid_request.db.delete = create_autospec( pyramid_request.db.delete, return_value=None ) ctrl = AuthClientEditController(authclient, pyramid_request) ctrl.delete() pyramid_request.db.delete.assert_called_with(authclient)
def test_delete_removes_auth_client(self, auth_client, pyramid_request): pyramid_request.db.delete = create_autospec(pyramid_request.db.delete, return_value=None) controller = AuthClientEditController(sentinel.context, pyramid_request) controller.delete() pyramid_request.db.delete.assert_called_with(auth_client)
def test_delete_redirects_to_index(self, authclient, matchers, pyramid_request): pyramid_request.db.delete = create_autospec(pyramid_request.db.delete, return_value=None) ctrl = AuthClientEditController(authclient, pyramid_request) response = ctrl.delete() expected_location = pyramid_request.route_url('admin.oauthclients') assert response == matchers.Redirect302To(expected_location)
def test_delete_redirects_to_index(self, authclient, matchers, pyramid_request): pyramid_request.db.delete = create_autospec( pyramid_request.db.delete, return_value=None ) ctrl = AuthClientEditController(authclient, pyramid_request) response = ctrl.delete() expected_location = pyramid_request.route_url("admin.oauthclients") assert response == matchers.Redirect302To(expected_location)