From 08b7b1c4144f18a9dbf52bfe0eb9182f2b4eba4a Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 23 Oct 2017 02:39:51 -0700 Subject: Reduce cfg boilerplate (#7689) * reduce cfg boilerplate * fix compile error * user test fix * another test fix * simplify diagnostics / testing --- app/channel_test.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'app/channel_test.go') diff --git a/app/channel_test.go b/app/channel_test.go index b1d403896..374b20657 100644 --- a/app/channel_test.go +++ b/app/channel_test.go @@ -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 { -- cgit v1.2.3-1-g7c22