0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-05-11 20:05:38 +02:00

test(integration): drop unused *http.Response return to satisfy bodyclose linter

This commit is contained in:
pandareen 2026-05-07 19:38:18 +05:30
parent 5287aba03e
commit 17d1047a85

View File

@ -73,7 +73,7 @@ func avatarTestServer(t *testing.T, requireGiteaUA bool) (srv *httptest.Server,
// triggerOAuth2AutoRegisterLogin performs a single OAuth2 callback with
// EnableAutoRegistration=true and a mocked goth.User. It is the closest
// integration-test reproduction of a real "first OIDC sign-in".
func triggerOAuth2AutoRegisterLogin(t *testing.T, sourceName, providerName string, gothUser goth.User) *http.Response {
func triggerOAuth2AutoRegisterLogin(t *testing.T, sourceName, providerName string, gothUser goth.User) {
t.Helper()
defer test.MockVariableValue(&setting.OAuth2Client.Username, "")()
defer test.MockVariableValue(&setting.OAuth2Client.EnableAutoRegistration, true)()
@ -84,8 +84,7 @@ func triggerOAuth2AutoRegisterLogin(t *testing.T, sourceName, providerName strin
session := emptyTestSession(t)
req := NewRequest(t, "GET", "/user/oauth2/"+sourceName+"/callback?code=XYZ&state=XYZ")
resp := session.MakeRequest(t, req, http.StatusSeeOther)
return resp.Result()
session.MakeRequest(t, req, http.StatusSeeOther)
}
// TestOAuth2AvatarFromPicture verifies the OIDC `picture` claim becomes the