diff options
author | Corey Hulen <corey@hulen.com> | 2017-08-16 09:51:45 -0700 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-08-16 09:51:45 -0700 |
commit | 0ab490845aed0ce3b58cbffd8ec35be237abda1c (patch) | |
tree | 5310cce7e546f5a03f97245af473b62d382028e8 /api4/team_test.go | |
parent | 32265df8be5d530f5b79284792afb9451464ad3a (diff) | |
download | chat-0ab490845aed0ce3b58cbffd8ec35be237abda1c.tar.gz chat-0ab490845aed0ce3b58cbffd8ec35be237abda1c.tar.bz2 chat-0ab490845aed0ce3b58cbffd8ec35be237abda1c.zip |
PLT-6226 Fixing races with licensing (#7213)
* PLT-6226 Fixing races with licensing
* Fixing build issue
* Fixing licensing issue
* removing commented code
Diffstat (limited to 'api4/team_test.go')
-rw-r--r-- | api4/team_test.go | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/api4/team_test.go b/api4/team_test.go index 421428afa..a498d1e04 100644 --- a/api4/team_test.go +++ b/api4/team_test.go @@ -826,12 +826,12 @@ func TestAddTeamMember(t *testing.T) { // Check effects of config and license changes. 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() }() @@ -845,9 +845,9 @@ func TestAddTeamMember(t *testing.T) { CheckNoError(t, resp) // 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() th.LoginBasic() @@ -859,9 +859,9 @@ func TestAddTeamMember(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() th.LoginBasic() @@ -885,9 +885,9 @@ func TestAddTeamMember(t *testing.T) { UpdateUserToNonTeamAdmin(th.BasicUser, th.BasicTeam) app.InvalidateAllCaches() *utils.Cfg.TeamSettings.RestrictTeamInvite = model.PERMISSIONS_ALL - 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() th.LoginBasic() @@ -897,8 +897,8 @@ func TestAddTeamMember(t *testing.T) { // Reset config and license. *utils.Cfg.TeamSettings.RestrictTeamInvite = restrictTeamInvite - utils.IsLicensed = isLicensed - utils.License = license + utils.SetIsLicensed(isLicensed) + utils.SetLicense(license) utils.SetDefaultRolesBasedOnConfig() th.LoginBasic() @@ -1040,12 +1040,12 @@ func TestAddTeamMembers(t *testing.T) { // Check effects of config and license changes. 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() }() @@ -1059,9 +1059,9 @@ func TestAddTeamMembers(t *testing.T) { CheckNoError(t, resp) // 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() th.LoginBasic() @@ -1073,9 +1073,9 @@ func TestAddTeamMembers(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() th.LoginBasic() @@ -1099,9 +1099,9 @@ func TestAddTeamMembers(t *testing.T) { UpdateUserToNonTeamAdmin(th.BasicUser, th.BasicTeam) app.InvalidateAllCaches() *utils.Cfg.TeamSettings.RestrictTeamInvite = model.PERMISSIONS_ALL - 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() th.LoginBasic() |