From 42c3ea64a9e2e75193d35939bbca34adfbd5ddf9 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Thu, 23 Mar 2017 18:37:39 -0400 Subject: [PATCH] Fix delete channel test (#5863) --- api4/channel_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/api4/channel_test.go b/api4/channel_test.go index 987678ee05..ef0d35e4b9 100644 --- a/api4/channel_test.go +++ b/api4/channel_test.go @@ -583,6 +583,9 @@ func TestDeleteChannel(t *testing.T) { // successful delete by team admin UpdateUserToTeamAdmin(user, team) app.InvalidateAllCaches() + utils.IsLicensed = true + utils.License = &model.License{Features: &model.Features{}} + utils.License.Features.SetDefaults() _, resp = Client.DeleteChannel(publicChannel6.Id) CheckNoError(t, resp) @@ -595,6 +598,9 @@ func TestDeleteChannel(t *testing.T) { utils.SetDefaultRolesBasedOnConfig() UpdateUserToNonTeamAdmin(user, team) app.InvalidateAllCaches() + utils.IsLicensed = true + utils.License = &model.License{Features: &model.Features{}} + utils.License.Features.SetDefaults() // channels created by SystemAdmin publicChannel6 = th.CreateChannelWithClient(th.SystemAdminClient, model.CHANNEL_OPEN) @@ -623,6 +629,9 @@ func TestDeleteChannel(t *testing.T) { // successful delete by team admin UpdateUserToTeamAdmin(th.BasicUser, team) app.InvalidateAllCaches() + utils.IsLicensed = true + utils.License = &model.License{Features: &model.Features{}} + utils.License.Features.SetDefaults() _, resp = Client.DeleteChannel(publicChannel6.Id) CheckNoError(t, resp) @@ -661,6 +670,9 @@ func TestDeleteChannel(t *testing.T) { // cannot delete by team admin UpdateUserToTeamAdmin(th.BasicUser, team) app.InvalidateAllCaches() + utils.IsLicensed = true + utils.License = &model.License{Features: &model.Features{}} + utils.License.Features.SetDefaults() _, resp = Client.DeleteChannel(publicChannel6.Id) CheckForbiddenStatus(t, resp)