diff options
author | Chris <ccbrown112@gmail.com> | 2018-02-07 16:20:51 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-07 16:20:51 -0600 |
commit | 0f703a3368a0b16fcd48b474377f0dbd2144f366 (patch) | |
tree | 4928199b534de6e1d42d8057c70ebe626b237d4a /api/user_test.go | |
parent | eff65aa05c74e93533c2504b8141b0474011e68c (diff) | |
download | chat-0f703a3368a0b16fcd48b474377f0dbd2144f366.tar.gz chat-0f703a3368a0b16fcd48b474377f0dbd2144f366.tar.bz2 chat-0f703a3368a0b16fcd48b474377f0dbd2144f366.zip |
Eliminate utils.SetLicense calls (#8217)
* eliminate utils.SetLicense calls
* test fix
* another test fix
* more test fixes
Diffstat (limited to 'api/user_test.go')
-rw-r--r-- | api/user_test.go | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/api/user_test.go b/api/user_test.go index 8d6aad22b..f65d7c45b 100644 --- a/api/user_test.go +++ b/api/user_test.go @@ -1889,17 +1889,7 @@ func TestUpdateMfa(t *testing.T) { Client := th.BasicClient - isLicensed := utils.IsLicensed() - license := utils.License() - defer func() { - utils.SetIsLicensed(isLicensed) - utils.SetLicense(license) - }() - utils.SetIsLicensed(false) - utils.SetLicense(&model.License{Features: &model.Features{}}) - if utils.License().Features.MFA == nil { - utils.License().Features.MFA = new(bool) - } + th.App.SetLicense(nil) team := model.Team{DisplayName: "Name", Name: "z-z-" + model.NewId() + "a", Email: "test@nowhere.com", Type: model.TEAM_OPEN} rteam, _ := Client.CreateTeam(&team) @@ -1925,8 +1915,7 @@ func TestUpdateMfa(t *testing.T) { t.Fatal("should have failed - not licensed") } - utils.SetIsLicensed(true) - *utils.License().Features.MFA = true + th.App.SetLicense(model.NewTestLicense("mfa")) th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableMultifactorAuthentication = true }) if _, err := Client.UpdateMfa(true, "123456"); err == nil { |