forked from forgejo/forgejo
Move some files into models' sub packages (#20262)
* Move some files into models' sub packages * Move functions * merge main branch * Fix check * fix check * Fix some tests * Fix lint * Fix lint * Revert lint changes * Fix error comments * Fix lint Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
parent
4a4bfafa23
commit
1d8543e7db
154 changed files with 1763 additions and 1738 deletions
|
@ -9,6 +9,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/models"
|
||||
activities_model "code.gitea.io/gitea/models/activities"
|
||||
"code.gitea.io/gitea/models/db"
|
||||
"code.gitea.io/gitea/models/organization"
|
||||
"code.gitea.io/gitea/models/perm"
|
||||
|
@ -56,7 +57,7 @@ func TestIncludesAllRepositoriesTeams(t *testing.T) {
|
|||
// Create repos.
|
||||
repoIds := make([]int64, 0)
|
||||
for i := 0; i < 3; i++ {
|
||||
r, err := CreateRepository(user, org.AsUser(), models.CreateRepoOptions{Name: fmt.Sprintf("repo-%d", i)})
|
||||
r, err := CreateRepository(user, org.AsUser(), CreateRepoOptions{Name: fmt.Sprintf("repo-%d", i)})
|
||||
assert.NoError(t, err, "CreateRepository %d", i)
|
||||
if r != nil {
|
||||
repoIds = append(repoIds, r.ID)
|
||||
|
@ -118,7 +119,7 @@ func TestIncludesAllRepositoriesTeams(t *testing.T) {
|
|||
}
|
||||
|
||||
// Create repo and check teams repositories.
|
||||
r, err := CreateRepository(user, org.AsUser(), models.CreateRepoOptions{Name: "repo-last"})
|
||||
r, err := CreateRepository(user, org.AsUser(), CreateRepoOptions{Name: "repo-last"})
|
||||
assert.NoError(t, err, "CreateRepository last")
|
||||
if r != nil {
|
||||
repoIds = append(repoIds, r.ID)
|
||||
|
@ -162,7 +163,7 @@ func TestUpdateRepositoryVisibilityChanged(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
// Check visibility of action has become private
|
||||
act := models.Action{}
|
||||
act := activities_model.Action{}
|
||||
_, err = db.GetEngine(db.DefaultContext).ID(3).Get(&act)
|
||||
|
||||
assert.NoError(t, err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue