mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-24 08:23:07 +02:00
test(integration): drop unused *http.Response return to satisfy bodyclose linter
This commit is contained in:
parent
5287aba03e
commit
17d1047a85
@ -73,7 +73,7 @@ func avatarTestServer(t *testing.T, requireGiteaUA bool) (srv *httptest.Server,
|
|||||||
// triggerOAuth2AutoRegisterLogin performs a single OAuth2 callback with
|
// triggerOAuth2AutoRegisterLogin performs a single OAuth2 callback with
|
||||||
// EnableAutoRegistration=true and a mocked goth.User. It is the closest
|
// EnableAutoRegistration=true and a mocked goth.User. It is the closest
|
||||||
// integration-test reproduction of a real "first OIDC sign-in".
|
// 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()
|
t.Helper()
|
||||||
defer test.MockVariableValue(&setting.OAuth2Client.Username, "")()
|
defer test.MockVariableValue(&setting.OAuth2Client.Username, "")()
|
||||||
defer test.MockVariableValue(&setting.OAuth2Client.EnableAutoRegistration, true)()
|
defer test.MockVariableValue(&setting.OAuth2Client.EnableAutoRegistration, true)()
|
||||||
@ -84,8 +84,7 @@ func triggerOAuth2AutoRegisterLogin(t *testing.T, sourceName, providerName strin
|
|||||||
|
|
||||||
session := emptyTestSession(t)
|
session := emptyTestSession(t)
|
||||||
req := NewRequest(t, "GET", "/user/oauth2/"+sourceName+"/callback?code=XYZ&state=XYZ")
|
req := NewRequest(t, "GET", "/user/oauth2/"+sourceName+"/callback?code=XYZ&state=XYZ")
|
||||||
resp := session.MakeRequest(t, req, http.StatusSeeOther)
|
session.MakeRequest(t, req, http.StatusSeeOther)
|
||||||
return resp.Result()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestOAuth2AvatarFromPicture verifies the OIDC `picture` claim becomes the
|
// TestOAuth2AvatarFromPicture verifies the OIDC `picture` claim becomes the
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user