mirror of
https://github.com/go-gitea/gitea.git
synced 2025-08-22 13:51:18 +00:00
test: use the add token auth method for token
This commit is contained in:
parent
8819a0a4fc
commit
3b2943a002
@ -89,9 +89,7 @@ func TestAPIListUserProjects(t *testing.T) {
|
|||||||
token := getUserToken(t, "user2", auth_model.AccessTokenScopeReadUser, auth_model.AccessTokenScopeReadIssue)
|
token := getUserToken(t, "user2", auth_model.AccessTokenScopeReadUser, auth_model.AccessTokenScopeReadIssue)
|
||||||
link, _ := url.Parse("/api/v1/user/projects")
|
link, _ := url.Parse("/api/v1/user/projects")
|
||||||
|
|
||||||
link.RawQuery = url.Values{"token": {token}}.Encode()
|
req := NewRequest(t, "GET", link.String()).AddTokenAuth(token)
|
||||||
|
|
||||||
req := NewRequest(t, "GET", link.String())
|
|
||||||
var apiProjects []*api.Project
|
var apiProjects []*api.Project
|
||||||
|
|
||||||
resp := MakeRequest(t, req, http.StatusOK)
|
resp := MakeRequest(t, req, http.StatusOK)
|
||||||
|
Loading…
Reference in New Issue
Block a user