MM24459: Implement ldap picture sync (#14540)
* implement ldap picture sync * add testing timeout, and no change * Revert "add testing timeout, and no change" This reverts commit 765621a7290074e5664c4ca2a2843c84e01f4cf1. * update app-layer * updates from code review * update app-layers * remove debug statements Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d7cb890f34
Коммит
e8081b7a0f
@@ -18,6 +18,7 @@ import (
|
||||
"github.com/mattermost/mattermost-server/v5/einterfaces"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
oauthgitlab "github.com/mattermost/mattermost-server/v5/model/gitlab"
|
||||
"github.com/mattermost/mattermost-server/v5/utils/testutils"
|
||||
)
|
||||
|
||||
func TestIsUsernameTaken(t *testing.T) {
|
||||
@@ -121,6 +122,31 @@ func TestSetDefaultProfileImage(t *testing.T) {
|
||||
assert.Equal(t, int64(0), user.LastPictureUpdate)
|
||||
}
|
||||
|
||||
func TestAdjustProfileImage(t *testing.T) {
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
_, err := th.App.AdjustImage(bytes.NewReader([]byte{}))
|
||||
require.Error(t, err)
|
||||
|
||||
// test image isn't the correct dimensions
|
||||
// it should be adjusted
|
||||
testjpg, error := testutils.ReadTestFile("testjpg.jpg")
|
||||
require.Nil(t, error)
|
||||
adjusted, err := th.App.AdjustImage(bytes.NewReader(testjpg))
|
||||
require.Nil(t, err)
|
||||
assert.True(t, adjusted.Len() > 0)
|
||||
assert.NotEqual(t, testjpg, adjusted)
|
||||
|
||||
// default image should require adjustement
|
||||
user := th.BasicUser
|
||||
image, err := th.App.GetDefaultProfileImage(user)
|
||||
require.Nil(t, err)
|
||||
image2, err := th.App.AdjustImage(bytes.NewReader(image))
|
||||
require.Nil(t, err)
|
||||
assert.Equal(t, image, image2.Bytes())
|
||||
}
|
||||
|
||||
func TestUpdateUserToRestrictedDomain(t *testing.T) {
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
Ссылка в новой задаче
Block a user