summaryrefslogtreecommitdiffstats
path: root/tests/integration/api_helper_for_declarative_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/api_helper_for_declarative_test.go')
-rw-r--r--tests/integration/api_helper_for_declarative_test.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/integration/api_helper_for_declarative_test.go b/tests/integration/api_helper_for_declarative_test.go
index dbfe502ec1..3524ce9834 100644
--- a/tests/integration/api_helper_for_declarative_test.go
+++ b/tests/integration/api_helper_for_declarative_test.go
@@ -13,6 +13,7 @@ import (
"testing"
"time"
+ "code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/models/perm"
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/modules/json"
@@ -31,9 +32,9 @@ type APITestContext struct {
ExpectedCode int
}
-func NewAPITestContext(t *testing.T, username, reponame string) APITestContext {
+func NewAPITestContext(t *testing.T, username, reponame string, scope ...auth.AccessTokenScope) APITestContext {
session := loginUser(t, username)
- token := getTokenForLoggedInUser(t, session)
+ token := getTokenForLoggedInUser(t, session, scope...)
return APITestContext{
Session: session,
Token: token,