Restore config after finisht the test case (#9085)

Этот коммит содержится в:
Carlos Tadeu Panato Junior
2018-07-11 12:58:16 +02:00
коммит произвёл GitHub
родитель 7c08ff9986
Коммит 7ed712f938
6 изменённых файлов: 152 добавлений и 5 удалений

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

@@ -170,6 +170,15 @@ func testCreatePostWithOutgoingHook(
team := th.BasicTeam
channel := th.BasicChannel
enableOutgoingWebhooks := th.App.Config().ServiceSettings.EnableOutgoingWebhooks
allowedUntrustedInternalConnections := th.App.Config().ServiceSettings.AllowedUntrustedInternalConnections
defer func() {
th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.EnableOutgoingWebhooks = enableOutgoingWebhooks })
th.App.UpdateConfig(func(cfg *model.Config) {
cfg.ServiceSettings.AllowedUntrustedInternalConnections = allowedUntrustedInternalConnections
})
}()
th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.EnableOutgoingWebhooks = true })
th.App.UpdateConfig(func(cfg *model.Config) {
*cfg.ServiceSettings.AllowedUntrustedInternalConnections = "localhost 127.0.0.1"