diff options
Diffstat (limited to 'services/auth/oauth2_test.go')
-rw-r--r-- | services/auth/oauth2_test.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/services/auth/oauth2_test.go b/services/auth/oauth2_test.go index 0d9e793cf3..f003742a94 100644 --- a/services/auth/oauth2_test.go +++ b/services/auth/oauth2_test.go @@ -4,7 +4,6 @@ package auth import ( - "context" "testing" "code.gitea.io/gitea/models/unittest" @@ -26,8 +25,8 @@ func TestUserIDFromToken(t *testing.T) { ds := make(reqctx.ContextData) o := OAuth2{} - uid := o.userIDFromToken(context.Background(), token, ds) - assert.Equal(t, int64(user_model.ActionsUserID), uid) + uid := o.userIDFromToken(t.Context(), token, ds) + assert.Equal(t, user_model.ActionsUserID, uid) assert.Equal(t, true, ds["IsActionsToken"]) assert.Equal(t, ds["ActionsTaskID"], int64(RunningTaskID)) }) @@ -48,7 +47,7 @@ func TestCheckTaskIsRunning(t *testing.T) { for name := range cases { c := cases[name] t.Run(name, func(t *testing.T) { - actual := CheckTaskIsRunning(context.Background(), c.TaskID) + actual := CheckTaskIsRunning(t.Context(), c.TaskID) assert.Equal(t, c.Expected, actual) }) } |