Remove license globals entirely (#8229)
* remove license globals entirely * fix infinite recursion * test fix
Этот коммит содержится в:
@@ -6,11 +6,10 @@ package app
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/utils"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
)
|
||||
|
||||
func TestCache(t *testing.T) {
|
||||
@@ -111,7 +110,7 @@ func TestGetSessionIdleTimeoutInMinutes(t *testing.T) {
|
||||
assert.Nil(t, err)
|
||||
|
||||
// Test regular session with license off, should not timeout
|
||||
*utils.License().Features.Compliance = false
|
||||
th.App.SetLicense(nil)
|
||||
|
||||
session = &model.Session{
|
||||
UserId: model.NewId(),
|
||||
@@ -125,7 +124,7 @@ func TestGetSessionIdleTimeoutInMinutes(t *testing.T) {
|
||||
_, err = th.App.GetSession(session.Token)
|
||||
assert.Nil(t, err)
|
||||
|
||||
*utils.License().Features.Compliance = true
|
||||
th.App.SetLicense(model.NewTestLicense("compliance"))
|
||||
|
||||
// Test regular session with timeout set to 0, should not timeout
|
||||
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.SessionIdleTimeoutInMinutes = 0 })
|
||||
|
||||
Ссылка в новой задаче
Block a user