From ce2b2be5de578bd9eb44b26e04db75ca61d67ca5 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 31 Oct 2017 09:39:31 -0500 Subject: Refactoring cfg refs and load / save functions (#7749) * refactoring cfg refs and load / save functions * improve error output --- app/apptestlib.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'app/apptestlib.go') diff --git a/app/apptestlib.go b/app/apptestlib.go index 3557a8727..b34749be3 100644 --- a/app/apptestlib.go +++ b/app/apptestlib.go @@ -48,12 +48,6 @@ func StopTestStore() { } func setupTestHelper(enterprise bool) *TestHelper { - if utils.T == nil { - utils.TranslationsPreInit() - } - utils.LoadConfig("config.json") - utils.InitTranslations(utils.Cfg.LocalizationSettings) - var options []Option if testStore != nil { options = append(options, StoreOverride(testStore)) @@ -63,8 +57,8 @@ func setupTestHelper(enterprise bool) *TestHelper { App: New(options...), } - *utils.Cfg.TeamSettings.MaxUsersPerTeam = 50 - *utils.Cfg.RateLimitSettings.Enable = false + th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.MaxUsersPerTeam = 50 }) + th.App.UpdateConfig(func(cfg *model.Config) { *cfg.RateLimitSettings.Enable = false }) utils.DisableDebugLogForTest() prevListenAddress := *th.App.Config().ServiceSettings.ListenAddress if testStore != nil { @@ -76,7 +70,7 @@ func setupTestHelper(enterprise bool) *TestHelper { utils.EnableDebugLogForTest() th.App.Srv.Store.MarkSystemRanUnitTests() - *utils.Cfg.TeamSettings.EnableOpenServer = true + th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.EnableOpenServer = true }) utils.SetIsLicensed(enterprise) if enterprise { -- cgit v1.2.3-1-g7c22