aboutsummaryrefslogtreecommitdiffstats
path: root/models/repo_test.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-05-20 22:08:52 +0800
committerGitHub <noreply@github.com>2022-05-20 22:08:52 +0800
commitfd7d83ace60258acf7139c4c787aa8af75b7ba8c (patch)
tree50038348ec10485f72344f3ac80324e04abc1283 /models/repo_test.go
parentd81e31ad7826a81fc7139f329f250594610a274b (diff)
downloadgitea-fd7d83ace60258acf7139c4c787aa8af75b7ba8c.tar.gz
gitea-fd7d83ace60258acf7139c4c787aa8af75b7ba8c.zip
Move almost all functions' parameter db.Engine to context.Context (#19748)
* Move almost all functions' parameter db.Engine to context.Context * remove some unnecessary wrap functions
Diffstat (limited to 'models/repo_test.go')
-rw-r--r--models/repo_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/models/repo_test.go b/models/repo_test.go
index a93d84b81b..dd1673f6bf 100644
--- a/models/repo_test.go
+++ b/models/repo_test.go
@@ -27,11 +27,11 @@ func TestWatchRepo(t *testing.T) {
const repoID = 3
const userID = 2
- assert.NoError(t, repo_model.WatchRepo(userID, repoID, true))
+ assert.NoError(t, repo_model.WatchRepo(db.DefaultContext, userID, repoID, true))
unittest.AssertExistsAndLoadBean(t, &repo_model.Watch{RepoID: repoID, UserID: userID})
unittest.CheckConsistencyFor(t, &repo_model.Repository{ID: repoID})
- assert.NoError(t, repo_model.WatchRepo(userID, repoID, false))
+ assert.NoError(t, repo_model.WatchRepo(db.DefaultContext, userID, repoID, false))
unittest.AssertNotExistsBean(t, &repo_model.Watch{RepoID: repoID, UserID: userID})
unittest.CheckConsistencyFor(t, &repo_model.Repository{ID: repoID})
}
@@ -179,7 +179,7 @@ func TestLinkedRepository(t *testing.T) {
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
- attach, err := repo_model.GetAttachmentByID(tc.attachID)
+ attach, err := repo_model.GetAttachmentByID(db.DefaultContext, tc.attachID)
assert.NoError(t, err)
repo, unitType, err := LinkedRepository(attach)
assert.NoError(t, err)