From ce2b2be5de578bd9eb44b26e04db75ca61d67ca5 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 31 Oct 2017 09:39:31 -0500 Subject: Refactoring cfg refs and load / save functions (#7749) * refactoring cfg refs and load / save functions * improve error output --- app/post_test.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'app/post_test.go') diff --git a/app/post_test.go b/app/post_test.go index 24910f964..e2e9a7261 100644 --- a/app/post_test.go +++ b/app/post_test.go @@ -15,7 +15,6 @@ import ( "github.com/stretchr/testify/require" "github.com/mattermost/mattermost-server/model" - "github.com/mattermost/mattermost-server/utils" ) func TestUpdatePostEditAt(t *testing.T) { @@ -82,11 +81,9 @@ func TestPostAction(t *testing.T) { th := Setup().InitBasic() defer th.TearDown() - allowedInternalConnections := *utils.Cfg.ServiceSettings.AllowedUntrustedInternalConnections - defer func() { - utils.Cfg.ServiceSettings.AllowedUntrustedInternalConnections = &allowedInternalConnections - }() - *utils.Cfg.ServiceSettings.AllowedUntrustedInternalConnections = "localhost 127.0.0.1" + th.App.UpdateConfig(func(cfg *model.Config) { + *cfg.ServiceSettings.AllowedUntrustedInternalConnections = "localhost 127.0.0.1" + }) ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { var request model.PostActionIntegrationRequest -- cgit v1.2.3-1-g7c22