* reduce cfg boilerplate

* fix compile error

* user test fix

* another test fix

* simplify diagnostics / testing
Этот коммит содержится в:
Chris
2017-10-23 02:39:51 -07:00
коммит произвёл GitHub
родитель fd6192473b
Коммит 08b7b1c414
13 изменённых файлов: 279 добавлений и 689 удалений

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

@@ -4,21 +4,16 @@ import (
"testing"
"github.com/mattermost/mattermost-server/model"
"github.com/mattermost/mattermost-server/utils"
)
func TestPermanentDeleteChannel(t *testing.T) {
th := Setup().InitBasic()
defer th.TearDown()
incomingWasEnabled := utils.Cfg.ServiceSettings.EnableIncomingWebhooks
outgoingWasEnabled := utils.Cfg.ServiceSettings.EnableOutgoingWebhooks
utils.Cfg.ServiceSettings.EnableIncomingWebhooks = true
utils.Cfg.ServiceSettings.EnableOutgoingWebhooks = true
defer func() {
utils.Cfg.ServiceSettings.EnableIncomingWebhooks = incomingWasEnabled
utils.Cfg.ServiceSettings.EnableOutgoingWebhooks = outgoingWasEnabled
}()
th.App.UpdateConfig(func(cfg *model.Config) {
cfg.ServiceSettings.EnableIncomingWebhooks = true
cfg.ServiceSettings.EnableOutgoingWebhooks = true
})
channel, err := th.App.CreateChannel(&model.Channel{DisplayName: "deletion-test", Name: "deletion-test", Type: model.CHANNEL_OPEN, TeamId: th.BasicTeam.Id}, false)
if err != nil {