summaryrefslogtreecommitdiffstats
path: root/app/apptestlib.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-10-31 09:39:31 -0500
committerJoram Wilander <jwawilander@gmail.com>2017-10-31 10:39:31 -0400
commitce2b2be5de578bd9eb44b26e04db75ca61d67ca5 (patch)
tree54203a18ecfb167dcf1d7e0742cea0ed9aab220a /app/apptestlib.go
parentb446d0aa0aa2bd3d87028b0543752eb539507481 (diff)
downloadchat-ce2b2be5de578bd9eb44b26e04db75ca61d67ca5.tar.gz
chat-ce2b2be5de578bd9eb44b26e04db75ca61d67ca5.tar.bz2
chat-ce2b2be5de578bd9eb44b26e04db75ca61d67ca5.zip
Refactoring cfg refs and load / save functions (#7749)
* refactoring cfg refs and load / save functions * improve error output
Diffstat (limited to 'app/apptestlib.go')
-rw-r--r--app/apptestlib.go12
1 files changed, 3 insertions, 9 deletions
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 {