summaryrefslogtreecommitdiffstats
path: root/api4/post_test.go
diff options
context:
space:
mode:
authorJesús Espino <jespinog@gmail.com>2018-02-09 16:31:01 +0100
committerMartin Kraft <mkraft@users.noreply.github.com>2018-02-09 10:31:01 -0500
commit0aa7ecd5e89f054ae927b246f2aec4bd6348d42b (patch)
tree1944001594c05731acfb998fc3840d2de456e511 /api4/post_test.go
parent96ffde43dc5dccef7af106dc8200566ff16ba1dc (diff)
downloadchat-0aa7ecd5e89f054ae927b246f2aec4bd6348d42b.tar.gz
chat-0aa7ecd5e89f054ae927b246f2aec4bd6348d42b.tar.bz2
chat-0aa7ecd5e89f054ae927b246f2aec4bd6348d42b.zip
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
Diffstat (limited to 'api4/post_test.go')
-rw-r--r--api4/post_test.go7
1 files changed, 0 insertions, 7 deletions
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,