diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2023-09-08 12:51:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-08 04:51:15 +0000 |
commit | 4f32abaf941ba30ade1f96930a05d14f1c6a6782 (patch) | |
tree | 9351b7d654b20db032867041b0292924ec93bb3f /tests/integration | |
parent | 3c0c27965836328abd2668dcd77710ee2460535e (diff) | |
download | gitea-4f32abaf941ba30ade1f96930a05d14f1c6a6782.tar.gz gitea-4f32abaf941ba30ade1f96930a05d14f1c6a6782.zip |
move repository deletion to service layer (#26948)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'tests/integration')
-rw-r--r-- | tests/integration/api_repo_test.go | 4 | ||||
-rw-r--r-- | tests/integration/mirror_pull_test.go | 2 | ||||
-rw-r--r-- | tests/integration/mirror_push_test.go | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/tests/integration/api_repo_test.go b/tests/integration/api_repo_test.go index 3933298f23..be4135b050 100644 --- a/tests/integration/api_repo_test.go +++ b/tests/integration/api_repo_test.go @@ -9,7 +9,6 @@ import ( "net/url" "testing" - "code.gitea.io/gitea/models" auth_model "code.gitea.io/gitea/models/auth" "code.gitea.io/gitea/models/db" access_model "code.gitea.io/gitea/models/perm/access" @@ -18,6 +17,7 @@ import ( user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/setting" api "code.gitea.io/gitea/modules/structs" + repo_service "code.gitea.io/gitea/services/repository" "code.gitea.io/gitea/tests" "github.com/stretchr/testify/assert" @@ -541,7 +541,7 @@ func TestAPIRepoTransfer(t *testing.T) { // cleanup repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: apiRepo.ID}) - _ = models.DeleteRepository(user, repo.OwnerID, repo.ID) + _ = repo_service.DeleteRepositoryDirectly(db.DefaultContext, user, repo.OwnerID, repo.ID) } func transfer(t *testing.T) *repo_model.Repository { diff --git a/tests/integration/mirror_pull_test.go b/tests/integration/mirror_pull_test.go index 2f79f5113b..964348d6ad 100644 --- a/tests/integration/mirror_pull_test.go +++ b/tests/integration/mirror_pull_test.go @@ -39,7 +39,7 @@ func TestMirrorPull(t *testing.T) { Releases: false, } - mirrorRepo, err := repo_service.CreateRepositoryDirectly(user, user, repo_service.CreateRepoOptions{ + mirrorRepo, err := repo_service.CreateRepositoryDirectly(db.DefaultContext, user, user, repo_service.CreateRepoOptions{ Name: opts.RepoName, Description: opts.Description, IsPrivate: opts.Private, diff --git a/tests/integration/mirror_push_test.go b/tests/integration/mirror_push_test.go index ab79db1861..c6f0c85616 100644 --- a/tests/integration/mirror_push_test.go +++ b/tests/integration/mirror_push_test.go @@ -39,7 +39,7 @@ func testMirrorPush(t *testing.T, u *url.URL) { user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) srcRepo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1}) - mirrorRepo, err := repo_service.CreateRepositoryDirectly(user, user, repo_service.CreateRepoOptions{ + mirrorRepo, err := repo_service.CreateRepositoryDirectly(db.DefaultContext, user, user, repo_service.CreateRepoOptions{ Name: "test-push-mirror", }) assert.NoError(t, err) |