mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Rename almost all Ctx functions (#22071)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user