summaryrefslogtreecommitdiffstats
path: root/api/apitestlib.go
diff options
context:
space:
mode:
Diffstat (limited to 'api/apitestlib.go')
-rw-r--r--api/apitestlib.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/api/apitestlib.go b/api/apitestlib.go
index 8d7f54902..47691b2dd 100644
--- a/api/apitestlib.go
+++ b/api/apitestlib.go
@@ -105,7 +105,11 @@ func setupTestHelper(enterprise bool) *TestHelper {
if testStore != nil {
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.ListenAddress = ":0" })
}
- th.App.StartServer()
+ serverErr := th.App.StartServer()
+ if serverErr != nil {
+ panic(serverErr)
+ }
+
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.ListenAddress = prevListenAddress })
api4.Init(th.App, th.App.Srv.Router, false)
Init(th.App, th.App.Srv.Router)
@@ -114,9 +118,10 @@ func setupTestHelper(enterprise bool) *TestHelper {
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.EnableOpenServer = true })
- utils.SetIsLicensed(enterprise)
if enterprise {
- utils.License().Features.SetDefaults()
+ th.App.SetLicense(model.NewTestLicense())
+ } else {
+ th.App.SetLicense(nil)
}
return th