mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-08 23:57:39 +00:00
[TESTS] testMiddlewareHook, dependency injection in integration tests
(cherry picked from commit6623630d10
) (cherry picked from commit5e30a4f950
)
This commit is contained in:
parent
8bd051e6df
commit
355a117e74
6 changed files with 32 additions and 18 deletions
|
@ -4,7 +4,6 @@
|
|||
package integration
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
|
@ -13,7 +12,6 @@ import (
|
|||
|
||||
"code.gitea.io/gitea/modules/json"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/routers"
|
||||
"code.gitea.io/gitea/tests"
|
||||
|
||||
"gitea.com/go-chi/session"
|
||||
|
@ -57,7 +55,7 @@ func TestSessionFileCreation(t *testing.T) {
|
|||
oldSessionConfig := setting.SessionConfig.ProviderConfig
|
||||
defer func() {
|
||||
setting.SessionConfig.ProviderConfig = oldSessionConfig
|
||||
c = routers.NormalRoutes(context.TODO())
|
||||
setNormalRoutes()
|
||||
}()
|
||||
|
||||
var config session.Options
|
||||
|
@ -76,7 +74,7 @@ func TestSessionFileCreation(t *testing.T) {
|
|||
|
||||
setting.SessionConfig.ProviderConfig = string(newConfigBytes)
|
||||
|
||||
c = routers.NormalRoutes(context.TODO())
|
||||
setNormalRoutes()
|
||||
|
||||
t.Run("NoSessionOnViewIssue", func(t *testing.T) {
|
||||
defer tests.PrintCurrentTest(t)()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue