diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2024-11-27 13:12:26 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-27 21:12:26 +0000 |
commit | f62f68cbdda07ae6933b4804bc757f35dc92d134 (patch) | |
tree | 6709319ec99caa6b22ed7d409f77ad17323f7808 /tests/integration/repo_fork_test.go | |
parent | 5a50b271e71b5e8bb7bdef149e07dcd2b0db3e3a (diff) | |
download | gitea-f62f68cbdda07ae6933b4804bc757f35dc92d134.tar.gz gitea-f62f68cbdda07ae6933b4804bc757f35dc92d134.zip |
Move team related functions to service layer (#32537)
There are still some functions under `models` after last big refactor
about `models`. This change will move all team related functions to
service layer with no code change.
Diffstat (limited to 'tests/integration/repo_fork_test.go')
-rw-r--r-- | tests/integration/repo_fork_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/integration/repo_fork_test.go b/tests/integration/repo_fork_test.go index 52b55888b9..e7c9853179 100644 --- a/tests/integration/repo_fork_test.go +++ b/tests/integration/repo_fork_test.go @@ -9,12 +9,12 @@ import ( "net/http/httptest" "testing" - "code.gitea.io/gitea/models" "code.gitea.io/gitea/models/db" org_model "code.gitea.io/gitea/models/organization" "code.gitea.io/gitea/models/unittest" user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/structs" + org_service "code.gitea.io/gitea/services/org" "code.gitea.io/gitea/tests" "github.com/stretchr/testify/assert" @@ -91,7 +91,7 @@ func TestForkListLimitedAndPrivateRepos(t *testing.T) { assert.EqualValues(t, structs.VisibleTypeLimited, limitedOrg.Visibility) ownerTeam1, err := org_model.OrgFromUser(limitedOrg).GetOwnerTeam(db.DefaultContext) assert.NoError(t, err) - assert.NoError(t, models.AddTeamMember(db.DefaultContext, ownerTeam1, user1)) + assert.NoError(t, org_service.AddTeamMember(db.DefaultContext, ownerTeam1, user1)) testRepoFork(t, user1Sess, "user2", "repo1", limitedOrg.Name, "repo1", "") // fork to a private org @@ -101,7 +101,7 @@ func TestForkListLimitedAndPrivateRepos(t *testing.T) { assert.EqualValues(t, structs.VisibleTypePrivate, privateOrg.Visibility) ownerTeam2, err := org_model.OrgFromUser(privateOrg).GetOwnerTeam(db.DefaultContext) assert.NoError(t, err) - assert.NoError(t, models.AddTeamMember(db.DefaultContext, ownerTeam2, user4)) + assert.NoError(t, org_service.AddTeamMember(db.DefaultContext, ownerTeam2, user4)) testRepoFork(t, user4Sess, "user2", "repo1", privateOrg.Name, "repo1", "") t.Run("Anonymous", func(t *testing.T) { @@ -120,7 +120,7 @@ func TestForkListLimitedAndPrivateRepos(t *testing.T) { htmlDoc := NewHTMLParser(t, resp.Body) assert.EqualValues(t, 1, htmlDoc.Find(forkItemSelector).Length()) - assert.NoError(t, models.AddTeamMember(db.DefaultContext, ownerTeam2, user1)) + assert.NoError(t, org_service.AddTeamMember(db.DefaultContext, ownerTeam2, user1)) resp = user1Sess.MakeRequest(t, req, http.StatusOK) htmlDoc = NewHTMLParser(t, resp.Body) assert.EqualValues(t, 2, htmlDoc.Find(forkItemSelector).Length()) |