diff options
Diffstat (limited to 'api/user_test.go')
-rw-r--r-- | api/user_test.go | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/api/user_test.go b/api/user_test.go index 68472c6d1..01784fadf 100644 --- a/api/user_test.go +++ b/api/user_test.go @@ -1823,16 +1823,19 @@ func TestUpdateMfa(t *testing.T) { th := Setup().InitBasic() Client := th.BasicClient - if utils.License.Features.MFA == nil { - utils.License.Features.MFA = new(bool) - } - + isLicensed := utils.IsLicensed + license := utils.License enableMfa := *utils.Cfg.ServiceSettings.EnableMultifactorAuthentication defer func() { - utils.IsLicensed = false - *utils.License.Features.MFA = false + utils.IsLicensed = isLicensed + utils.License = license *utils.Cfg.ServiceSettings.EnableMultifactorAuthentication = enableMfa }() + utils.IsLicensed = false + utils.License = &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) |