Refactoring cfg refs and load / save functions (#7749)

* refactoring cfg refs and load / save functions

* improve error output
Этот коммит содержится в:
Chris
2017-10-31 09:39:31 -05:00
коммит произвёл Joram Wilander
родитель b446d0aa0a
Коммит ce2b2be5de
28 изменённых файлов: 250 добавлений и 247 удалений

Просмотреть файл

@@ -73,12 +73,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 []app.Option
if testStore != nil {
options = append(options, app.StoreOverride(testStore))
@@ -89,9 +83,11 @@ func setupTestHelper(enterprise bool) *TestHelper {
}
th.originalConfig = th.App.Config().Clone()
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.MaxUsersPerTeam = 50 })
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.RateLimitSettings.Enable = false })
th.App.UpdateConfig(func(cfg *model.Config) { cfg.EmailSettings.SendEmailNotifications = true })
th.App.UpdateConfig(func(cfg *model.Config) {
*cfg.TeamSettings.MaxUsersPerTeam = 50
*cfg.RateLimitSettings.Enable = false
cfg.EmailSettings.SendEmailNotifications = true
})
utils.DisableDebugLogForTest()
prevListenAddress := *th.App.Config().ServiceSettings.ListenAddress
if testStore != nil {