test: use the add token auth method for token

This commit is contained in:
dineshsalunke 2024-01-17 23:20:02 +05:30
parent 8819a0a4fc
commit 3b2943a002

View File

@ -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)