diff options
author | Derrick Anderson <derrick@andersonwebstudio.com> | 2018-02-12 16:13:01 -0500 |
---|---|---|
committer | Derrick Anderson <derrick@andersonwebstudio.com> | 2018-02-12 16:13:01 -0500 |
commit | 32c1f7be239ddb19d6c59b114d9ae1a543f8ba9c (patch) | |
tree | 5e1653318a6a14bcad80025793adab0f700deed9 /api/user_test.go | |
parent | 62efb1df754bfe6b10a3c17ca6f89fd33b991f56 (diff) | |
parent | c209e4457457edc042f063390c9a222a694f3a6d (diff) | |
download | chat-32c1f7be239ddb19d6c59b114d9ae1a543f8ba9c.tar.gz chat-32c1f7be239ddb19d6c59b114d9ae1a543f8ba9c.tar.bz2 chat-32c1f7be239ddb19d6c59b114d9ae1a543f8ba9c.zip |
Merge branch 'release-4.7-revertmaster' into release-4.7
Diffstat (limited to 'api/user_test.go')
-rw-r--r-- | api/user_test.go | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/api/user_test.go b/api/user_test.go index f65d7c45b..8d6aad22b 100644 --- a/api/user_test.go +++ b/api/user_test.go @@ -1889,7 +1889,17 @@ func TestUpdateMfa(t *testing.T) { Client := th.BasicClient - th.App.SetLicense(nil) + 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) + } team := model.Team{DisplayName: "Name", Name: "z-z-" + model.NewId() + "a", Email: "test@nowhere.com", Type: model.TEAM_OPEN} rteam, _ := Client.CreateTeam(&team) @@ -1915,7 +1925,8 @@ func TestUpdateMfa(t *testing.T) { t.Fatal("should have failed - not licensed") } - th.App.SetLicense(model.NewTestLicense("mfa")) + utils.SetIsLicensed(true) + *utils.License().Features.MFA = true th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableMultifactorAuthentication = true }) if _, err := Client.UpdateMfa(true, "123456"); err == nil { |