don't clear AuthService/AuthData if user is System Admin (#12986)

Этот коммит содержится в:
Scott Bishel
2019-11-07 12:12:37 -07:00
коммит произвёл GitHub
родитель 540cfb0239
Коммит e07e114def
3 изменённых файлов: 14 добавлений и 7 удалений

Просмотреть файл

@@ -110,10 +110,15 @@ func TestCreateUserInputFilter(t *testing.T) {
_, resp := th.SystemAdminClient.CreateUser(user)
CheckBadRequestStatus(t, resp)
})
t.Run("AuthServiceFilter", func(t *testing.T) {
user := &model.User{Email: "foobar+testdomainrestriction@mattermost.org", Password: "Password1", Username: GenerateTestUsername(), AuthService: "ldap"}
t.Run("ValidAuthServiceFilter", func(t *testing.T) {
user := &model.User{Email: "foobar+testdomainrestriction@mattermost.org", Username: GenerateTestUsername(), AuthService: "ldap", AuthData: model.NewString("999099")}
_, resp := th.SystemAdminClient.CreateUser(user)
CheckNoError(t, resp)
})
t.Run("InvalidAuthServiceFilter", func(t *testing.T) {
user := &model.User{Email: "foobar+testdomainrestriction@mattermost.org", Password: "Password1", Username: GenerateTestUsername(), AuthService: "ldap"}
_, resp := th.Client.CreateUser(user)
CheckBadRequestStatus(t, resp)
})
})