summaryrefslogtreecommitdiffstats
path: root/api/team_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'api/team_test.go')
-rw-r--r--api/team_test.go34
1 files changed, 17 insertions, 17 deletions
diff --git a/api/team_test.go b/api/team_test.go
index 3c05588ce..99e54a904 100644
--- a/api/team_test.go
+++ b/api/team_test.go
@@ -95,12 +95,12 @@ func TestAddUserToTeam(t *testing.T) {
// Restore config/license at end of test case.
restrictTeamInvite := *utils.Cfg.TeamSettings.RestrictTeamInvite
- isLicensed := utils.IsLicensed
- license := utils.License
+ isLicensed := utils.IsLicensed()
+ license := utils.License()
defer func() {
*utils.Cfg.TeamSettings.RestrictTeamInvite = restrictTeamInvite
- utils.IsLicensed = isLicensed
- utils.License = license
+ utils.SetIsLicensed(isLicensed)
+ utils.SetLicense(license)
utils.SetDefaultRolesBasedOnConfig()
}()
@@ -115,9 +115,9 @@ func TestAddUserToTeam(t *testing.T) {
}
// Add an EE license.
- utils.IsLicensed = true
- utils.License = &model.License{Features: &model.Features{}}
- utils.License.Features.SetDefaults()
+ utils.SetIsLicensed(true)
+ utils.SetLicense(&model.License{Features: &model.Features{}})
+ utils.License().Features.SetDefaults()
utils.SetDefaultRolesBasedOnConfig()
// Check that a regular user can't add someone to the team.
@@ -130,9 +130,9 @@ func TestAddUserToTeam(t *testing.T) {
UpdateUserToTeamAdmin(th.BasicUser, th.BasicTeam)
app.InvalidateAllCaches()
*utils.Cfg.TeamSettings.RestrictTeamInvite = model.PERMISSIONS_TEAM_ADMIN
- utils.IsLicensed = true
- utils.License = &model.License{Features: &model.Features{}}
- utils.License.Features.SetDefaults()
+ utils.SetIsLicensed(true)
+ utils.SetLicense(&model.License{Features: &model.Features{}})
+ utils.License().Features.SetDefaults()
utils.SetDefaultRolesBasedOnConfig()
user5 := th.CreateUser(th.BasicClient)
@@ -386,16 +386,16 @@ func TestInviteMembers(t *testing.T) {
t.Fatal(err)
}
- isLicensed := utils.IsLicensed
- license := utils.License
+ isLicensed := utils.IsLicensed()
+ license := utils.License()
defer func() {
- utils.IsLicensed = isLicensed
- utils.License = license
+ utils.SetIsLicensed(isLicensed)
+ utils.SetLicense(license)
utils.SetDefaultRolesBasedOnConfig()
}()
- utils.IsLicensed = true
- utils.License = &model.License{Features: &model.Features{}}
- utils.License.Features.SetDefaults()
+ utils.SetIsLicensed(true)
+ utils.SetLicense(&model.License{Features: &model.Features{}})
+ utils.License().Features.SetDefaults()
utils.SetDefaultRolesBasedOnConfig()
if _, err := Client.InviteMembers(invites); err == nil {