Remove incorrect "db.DefaultContext" usages (#35366)

This commit is contained in:
wxiaoguang
2025-08-28 11:52:43 +08:00
committed by GitHub
parent 7aef7ea2d4
commit 0cbaa0b662
256 changed files with 1951 additions and 2098 deletions

View File

@ -8,7 +8,6 @@ import (
"testing"
"time"
"code.gitea.io/gitea/models/db"
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/models/unittest"
"code.gitea.io/gitea/modules/git"
@ -125,11 +124,11 @@ func TestPushCommits_AvatarLink(t *testing.T) {
assert.Equal(t,
"/avatars/ab53a2911ddf9b4817ac01ddcd3d975f?size="+strconv.Itoa(28*setting.Avatar.RenderedSizeFactor),
pushCommits.AvatarLink(db.DefaultContext, "user2@example.com"))
pushCommits.AvatarLink(t.Context(), "user2@example.com"))
assert.Equal(t,
"/assets/img/avatar_default.png",
pushCommits.AvatarLink(db.DefaultContext, "nonexistent@example.com"))
pushCommits.AvatarLink(t.Context(), "nonexistent@example.com"))
}
func TestCommitToPushCommit(t *testing.T) {