summaryrefslogtreecommitdiffstats
path: root/api/user_test.go
diff options
context:
space:
mode:
authorJonathan Fritz <jonathan.fritz@mattermost.com>2018-02-13 08:39:56 -0500
committerJonathan Fritz <jonathan.fritz@mattermost.com>2018-02-13 08:39:56 -0500
commit18fa32567b56584c6e24da2ae68814d5bf8ece6f (patch)
tree311ab6a3918ba64ac665286f15950b32dc1b1dba /api/user_test.go
parent7b2861de3a09cf00d00b0872cc537d54302c4bfa (diff)
parent8b79f5d49cb8d4877e136a76e515edef41ef6f28 (diff)
downloadchat-18fa32567b56584c6e24da2ae68814d5bf8ece6f.tar.gz
chat-18fa32567b56584c6e24da2ae68814d5bf8ece6f.tar.bz2
chat-18fa32567b56584c6e24da2ae68814d5bf8ece6f.zip
Merge branch 'release-4.7' into XYZ-110
Diffstat (limited to 'api/user_test.go')
-rw-r--r--api/user_test.go15
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 {