Skip to content

Commit 879a8e7

Browse files
committed
fix test
1 parent 17abc0b commit 879a8e7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

services/context/context_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ func TestRemoveSessionCookieHeader(t *testing.T) {
2626
}
2727

2828
func TestRedirectToCurrentSite(t *testing.T) {
29+
setting.IsInTesting = true
2930
defer test.MockVariableValue(&setting.AppURL, "http://localhost:3000/sub/")()
3031
defer test.MockVariableValue(&setting.AppSubURL, "/sub")()
3132
cases := []struct {
@@ -40,7 +41,7 @@ func TestRedirectToCurrentSite(t *testing.T) {
4041
t.Run(c.location, func(t *testing.T) {
4142
req := &http.Request{URL: &url.URL{Path: "/"}}
4243
resp := httptest.NewRecorder()
43-
base := NewBaseContext(resp, req)
44+
base := NewBaseContextForTest(resp, req)
4445
ctx := NewWebContext(base, nil, nil)
4546
ctx.RedirectToCurrentSite(c.location)
4647
redirect := test.RedirectURL(resp)

0 commit comments

Comments
 (0)