From 0aa7ecd5e89f054ae927b246f2aec4bd6348d42b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Fri, 9 Feb 2018 16:31:01 +0100 Subject: AllowEditPost and PostEditTimeLimit migration (#8208) * AllowEditPost and PostEditTimeLimit migration * Not set EDIT_POST permission to sysadmin_role if ALLOW_EDIT_POST is configured to NEVER * Remove a bit of code duplication --- api4/post_test.go | 7 ------- 1 file changed, 7 deletions(-) (limited to 'api4/post_test.go') diff --git a/api4/post_test.go b/api4/post_test.go index de627d8bc..52326c4b0 100644 --- a/api4/post_test.go +++ b/api4/post_test.go @@ -489,16 +489,13 @@ func TestUpdatePost(t *testing.T) { isLicensed := utils.IsLicensed() license := utils.License() - allowEditPost := *th.App.Config().ServiceSettings.AllowEditPost defer func() { utils.SetIsLicensed(isLicensed) utils.SetLicense(license) - th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.AllowEditPost = allowEditPost }) }() utils.SetIsLicensed(true) utils.SetLicense(&model.License{Features: &model.Features{}}) utils.License().Features.SetDefaults() - th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.AllowEditPost = model.ALLOW_EDIT_POST_ALWAYS }) post := &model.Post{ChannelId: channel.Id, Message: "zz" + model.NewId() + "a"} rpost, resp := Client.CreatePost(post) @@ -571,18 +568,14 @@ func TestPatchPost(t *testing.T) { isLicensed := utils.IsLicensed() license := utils.License() - allowEditPost := *th.App.Config().ServiceSettings.AllowEditPost defer func() { utils.SetIsLicensed(isLicensed) utils.SetLicense(license) - th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.AllowEditPost = allowEditPost }) }() utils.SetIsLicensed(true) utils.SetLicense(&model.License{Features: &model.Features{}}) utils.License().Features.SetDefaults() - th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.AllowEditPost = model.ALLOW_EDIT_POST_ALWAYS }) - post := &model.Post{ ChannelId: channel.Id, IsPinned: true, -- cgit v1.2.3-1-g7c22