Reduce cfg boilerplate (#7689)
* reduce cfg boilerplate * fix compile error * user test fix * another test fix * simplify diagnostics / testing
Этот коммит содержится в:
@@ -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 {
|
||||
|
||||
Ссылка в новой задаче
Block a user