mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Merge branch 'release-3.7'
This commit is contained in:
@@ -92,10 +92,10 @@ func TestCreateChannel(t *testing.T) {
|
||||
}()
|
||||
*utils.Cfg.TeamSettings.RestrictPublicChannelCreation = model.PERMISSIONS_ALL
|
||||
*utils.Cfg.TeamSettings.RestrictPrivateChannelCreation = model.PERMISSIONS_ALL
|
||||
utils.SetDefaultRolesBasedOnConfig()
|
||||
utils.IsLicensed = true
|
||||
utils.License = &model.License{Features: &model.Features{}}
|
||||
utils.License.Features.SetDefaults()
|
||||
utils.SetDefaultRolesBasedOnConfig()
|
||||
|
||||
channel.Name = GenerateTestChannelName()
|
||||
_, resp = Client.CreateChannel(channel)
|
||||
@@ -161,6 +161,19 @@ func TestCreateChannel(t *testing.T) {
|
||||
_, resp = th.SystemAdminClient.CreateChannel(private)
|
||||
CheckNoError(t, resp)
|
||||
|
||||
// Check that if unlicensed the policy restriction is not enforced.
|
||||
utils.IsLicensed = false
|
||||
utils.License = nil
|
||||
utils.SetDefaultRolesBasedOnConfig()
|
||||
|
||||
channel.Name = GenerateTestChannelName()
|
||||
_, resp = Client.CreateChannel(channel)
|
||||
CheckNoError(t, resp)
|
||||
|
||||
private.Name = GenerateTestChannelName()
|
||||
_, resp = Client.CreateChannel(private)
|
||||
CheckNoError(t, resp)
|
||||
|
||||
if r, err := Client.DoApiPost("/channels", "garbage"); err == nil {
|
||||
t.Fatal("should have errored")
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user