summaryrefslogtreecommitdiffstats
path: root/app/app_test.go
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2018-02-13 13:35:52 +0000
committerGeorge Goldberg <george@gberg.me>2018-02-13 13:46:01 +0000
commit5c101253c5987743cf1b3a8fe68814d748070622 (patch)
treee2632505d051e7d15d6daf974ed8ac92095f82fe /app/app_test.go
parentb7fc3d7d35ca4dd16097715a66463392a1dfaf0a (diff)
parentd88d2bc2ed3aefa68b5ed2942f493ae42bb40bfa (diff)
downloadchat-5c101253c5987743cf1b3a8fe68814d748070622.tar.gz
chat-5c101253c5987743cf1b3a8fe68814d748070622.tar.bz2
chat-5c101253c5987743cf1b3a8fe68814d748070622.zip
Merge branch 'master' into advanced-permissions-phase-1
Diffstat (limited to 'app/app_test.go')
-rw-r--r--app/app_test.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/app/app_test.go b/app/app_test.go
index 4a4238197..f31e0332c 100644
--- a/app/app_test.go
+++ b/app/app_test.go
@@ -226,16 +226,12 @@ func TestDoAdvancedPermissionsMigration(t *testing.T) {
}
// Add a license and change the policy config.
- isLicensed := utils.IsLicensed()
- license := utils.License()
restrictPublicChannel := *th.App.Config().TeamSettings.RestrictPublicChannelManagement
restrictPrivateChannel := *th.App.Config().TeamSettings.RestrictPrivateChannelManagement
defer func() {
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.RestrictPublicChannelManagement = restrictPublicChannel })
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.RestrictPrivateChannelManagement = restrictPrivateChannel })
- utils.SetIsLicensed(isLicensed)
- utils.SetLicense(license)
}()
th.App.UpdateConfig(func(cfg *model.Config) {
@@ -244,9 +240,7 @@ func TestDoAdvancedPermissionsMigration(t *testing.T) {
th.App.UpdateConfig(func(cfg *model.Config) {
*cfg.TeamSettings.RestrictPrivateChannelManagement = model.PERMISSIONS_TEAM_ADMIN
})
- utils.SetIsLicensed(true)
- utils.SetLicense(&model.License{Features: &model.Features{}})
- utils.License().Features.SetDefaults()
+ th.App.SetLicense(model.NewTestLicense())
// Check the migration doesn't change anything if run again.
th.App.DoAdvancedPermissionsMigration()
@@ -394,7 +388,7 @@ func TestDoAdvancedPermissionsMigration(t *testing.T) {
}
// Remove the license.
- utils.SetIsLicensed(false)
+ th.App.SetLicense(nil)
// Do the migration again.
th.ResetRoleMigration()