Merge pull request 'Data size unit localization' (#2528) from 0ko/forgejo:sizelocalize into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2528
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
This commit is contained in:
Earl Warren 2024-04-01 19:31:26 +00:00
commit 385bcca788
25 changed files with 237 additions and 32 deletions

View file

@ -218,6 +218,16 @@ func (s *TestSession) GetCookie(name string) *http.Cookie {
return nil
}
func (s *TestSession) SetCookie(cookie *http.Cookie) *http.Cookie {
baseURL, err := url.Parse(setting.AppURL)
if err != nil {
return nil
}
s.jar.SetCookies(baseURL, []*http.Cookie{cookie})
return nil
}
func (s *TestSession) MakeRequest(t testing.TB, rw *RequestWrapper, expectedStatus int) *httptest.ResponseRecorder {
t.Helper()
req := rw.Request