mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-02 16:35:19 +02:00
Remove session in api tests (#21984)
It's no meaning to request an API route with session.
This commit is contained in:
parent
665d02efaf
commit
df676a47d0
46 changed files with 387 additions and 433 deletions
|
@ -29,7 +29,7 @@ func TestAPIUserSearchLoggedIn(t *testing.T) {
|
|||
token := getTokenForLoggedInUser(t, session)
|
||||
query := "user2"
|
||||
req := NewRequestf(t, "GET", "/api/v1/users/search?token=%s&q=%s", token, query)
|
||||
resp := session.MakeRequest(t, req, http.StatusOK)
|
||||
resp := MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
var results SearchResults
|
||||
DecodeJSON(t, resp, &results)
|
||||
|
@ -69,7 +69,7 @@ func TestAPIUserSearchAdminLoggedInUserHidden(t *testing.T) {
|
|||
query := "user31"
|
||||
req := NewRequestf(t, "GET", "/api/v1/users/search?token=%s&q=%s", token, query)
|
||||
req.SetBasicAuth(token, "x-oauth-basic")
|
||||
resp := session.MakeRequest(t, req, http.StatusOK)
|
||||
resp := MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
var results SearchResults
|
||||
DecodeJSON(t, resp, &results)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue