forked from forgejo/forgejo
Rename almost all Ctx functions (#22071)
This commit is contained in:
parent
097d4e30b1
commit
68704532c2
78 changed files with 562 additions and 611 deletions
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/models/db"
|
||||
repo_model "code.gitea.io/gitea/models/repo"
|
||||
"code.gitea.io/gitea/models/unittest"
|
||||
user_model "code.gitea.io/gitea/models/user"
|
||||
|
@ -57,7 +58,7 @@ func TestMirrorPull(t *testing.T) {
|
|||
defer gitRepo.Close()
|
||||
|
||||
findOptions := repo_model.FindReleasesOptions{IncludeDrafts: true, IncludeTags: true}
|
||||
initCount, err := repo_model.GetReleaseCountByRepoID(mirror.ID, findOptions)
|
||||
initCount, err := repo_model.GetReleaseCountByRepoID(db.DefaultContext, mirror.ID, findOptions)
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.NoError(t, release_service.CreateRelease(gitRepo, &repo_model.Release{
|
||||
|
@ -80,7 +81,7 @@ func TestMirrorPull(t *testing.T) {
|
|||
ok := mirror_service.SyncPullMirror(ctx, mirror.ID)
|
||||
assert.True(t, ok)
|
||||
|
||||
count, err := repo_model.GetReleaseCountByRepoID(mirror.ID, findOptions)
|
||||
count, err := repo_model.GetReleaseCountByRepoID(db.DefaultContext, mirror.ID, findOptions)
|
||||
assert.NoError(t, err)
|
||||
assert.EqualValues(t, initCount+1, count)
|
||||
|
||||
|
@ -91,7 +92,7 @@ func TestMirrorPull(t *testing.T) {
|
|||
ok = mirror_service.SyncPullMirror(ctx, mirror.ID)
|
||||
assert.True(t, ok)
|
||||
|
||||
count, err = repo_model.GetReleaseCountByRepoID(mirror.ID, findOptions)
|
||||
count, err = repo_model.GetReleaseCountByRepoID(db.DefaultContext, mirror.ID, findOptions)
|
||||
assert.NoError(t, err)
|
||||
assert.EqualValues(t, initCount, count)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue