diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-12-02 11:39:42 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-01 22:39:42 -0500 |
commit | df676a47d05b20f7bfe4fdae350f50af15b52905 (patch) | |
tree | dc747e21fd2a533aeacb1686f747bba0a8f60736 /tests/integration/api_wiki_test.go | |
parent | 665d02efaf6ebaadf3ffb5b412ea77c4502f0baf (diff) | |
download | gitea-df676a47d05b20f7bfe4fdae350f50af15b52905.tar.gz gitea-df676a47d05b20f7bfe4fdae350f50af15b52905.zip |
Remove session in api tests (#21984)
It's no meaning to request an API route with session.
Diffstat (limited to 'tests/integration/api_wiki_test.go')
-rw-r--r-- | tests/integration/api_wiki_test.go | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tests/integration/api_wiki_test.go b/tests/integration/api_wiki_test.go index d56b04e913..546f4d0e3e 100644 --- a/tests/integration/api_wiki_test.go +++ b/tests/integration/api_wiki_test.go @@ -19,12 +19,11 @@ func TestAPIGetWikiPage(t *testing.T) { defer tests.PrepareTestEnv(t)() username := "user2" - session := loginUser(t, username) urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/wiki/page/Home", username, "repo1") req := NewRequest(t, "GET", urlStr) - resp := session.MakeRequest(t, req, http.StatusOK) + resp := MakeRequest(t, req, http.StatusOK) var page *api.WikiPage DecodeJSON(t, resp, &page) @@ -65,12 +64,11 @@ func TestAPIListWikiPages(t *testing.T) { defer tests.PrepareTestEnv(t)() username := "user2" - session := loginUser(t, username) urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/wiki/pages", username, "repo1") req := NewRequest(t, "GET", urlStr) - resp := session.MakeRequest(t, req, http.StatusOK) + resp := MakeRequest(t, req, http.StatusOK) var meta []*api.WikiPageMetaData DecodeJSON(t, resp, &meta) @@ -190,7 +188,7 @@ func TestAPINewWikiPage(t *testing.T) { ContentBase64: base64.StdEncoding.EncodeToString([]byte("Wiki page content for API unit tests")), Message: "", }) - session.MakeRequest(t, req, http.StatusCreated) + MakeRequest(t, req, http.StatusCreated) } } @@ -207,18 +205,17 @@ func TestAPIEditWikiPage(t *testing.T) { ContentBase64: base64.StdEncoding.EncodeToString([]byte("Edited wiki page content for API unit tests")), Message: "", }) - session.MakeRequest(t, req, http.StatusOK) + MakeRequest(t, req, http.StatusOK) } func TestAPIListPageRevisions(t *testing.T) { defer tests.PrepareTestEnv(t)() username := "user2" - session := loginUser(t, username) urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/wiki/revisions/Home", username, "repo1") req := NewRequest(t, "GET", urlStr) - resp := session.MakeRequest(t, req, http.StatusOK) + resp := MakeRequest(t, req, http.StatusOK) var revisions *api.WikiCommitList DecodeJSON(t, resp, &revisions) |