[PORT] Add cache test for admins (#31265)
* the cache was not refactored in Forgejo * fix the test modifying a global variable
This commit is contained in:
parent
77da92f42a
commit
9c48511c69
2 changed files with 8 additions and 6 deletions
3
modules/cache/cache_test.go
vendored
3
modules/cache/cache_test.go
vendored
|
@ -9,6 +9,7 @@ import (
|
|||
"time"
|
||||
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/test"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
@ -35,7 +36,7 @@ func TestNewContext(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestTest(t *testing.T) {
|
||||
defaultCache = nil
|
||||
defer test.MockVariableValue(&conn, nil)()
|
||||
_, err := Test()
|
||||
assert.Error(t, err)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue