summaryrefslogtreecommitdiffstats
path: root/api/post_test.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2017-08-16 09:51:45 -0700
committerChristopher Speller <crspeller@gmail.com>2017-08-16 09:51:45 -0700
commit0ab490845aed0ce3b58cbffd8ec35be237abda1c (patch)
tree5310cce7e546f5a03f97245af473b62d382028e8 /api/post_test.go
parent32265df8be5d530f5b79284792afb9451464ad3a (diff)
downloadchat-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/post_test.go')
-rw-r--r--api/post_test.go32
1 files changed, 16 insertions, 16 deletions
diff --git a/api/post_test.go b/api/post_test.go
index a48ad4f51..29c1f791a 100644
--- a/api/post_test.go
+++ b/api/post_test.go
@@ -409,15 +409,15 @@ func TestUpdatePost(t *testing.T) {
}
// Test licensed policy controls for edit post
- 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.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.Cfg.ServiceSettings.AllowEditPost = model.ALLOW_EDIT_POST_NEVER
@@ -951,15 +951,15 @@ func TestDeletePosts(t *testing.T) {
}
// Test licensed policy controls for delete post
- 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.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()
UpdateUserToTeamAdmin(th.BasicUser2, th.BasicTeam)
@@ -1014,8 +1014,8 @@ func TestDeletePosts(t *testing.T) {
}
// Check that if unlicensed the policy restriction is not enforced.
- utils.IsLicensed = false
- utils.License = nil
+ utils.SetIsLicensed(false)
+ utils.SetLicense(nil)
utils.SetDefaultRolesBasedOnConfig()
time.Sleep(10 * time.Millisecond)