def METHOD_NAME(
    db: orm.Session,
    project: project_models.DatabaseProject,
    capella_model: toolmodels_models.CapellaModel,
    pipeline: pipelines_models.DatabaseBackup,
    client: testclient.TestClient,
    monkeypatch: pytest.MonkeyPatch,
    mockoperator: MockOperator,
    run_nightly: bool,
):
    def mock_remove_user_from_repository(
        instance: t4c_models.DatabaseT4CInstance,
        repository_name: str,
        username: str,
    ):
        return
    monkeypatch.setattr(
        t4c_repositories_interface,
        "remove_user_from_repository",
        mock_remove_user_from_repository,
    )
    response = client.delete(
        f"/api/v1/projects/{project.slug}/models/{capella_model.slug}/backups/pipelines/{pipeline.id}",
    )
    assert response.status_code == 204
    assert not pipelines_crud.get_pipeline_by_id(db, pipeline.id)
    if run_nightly:
        assert mockoperator.cronjob_counter == -1