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 /api/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 'api/team_test.go')
-rw-r--r-- | api/team_test.go | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/api/team_test.go b/api/team_test.go index e09bf42ef..7d10ca6e3 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) @@ -381,16 +381,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 { |