Migrate store methods to use request.Context instead of context.Context (#24836)

Этот коммит содержится в:
Ben Schumacher
2023-10-11 13:08:55 +02:00
коммит произвёл GitHub
родитель 0d5a8b8841
Коммит 13c05a571f
127 изменённых файлов: 1030 добавлений и 921 удалений

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

@@ -12,6 +12,7 @@ import (
"github.com/stretchr/testify/mock"
"github.com/mattermost/mattermost/server/public/model"
"github.com/mattermost/mattermost/server/public/shared/request"
"github.com/mattermost/mattermost/server/v8/channels/store"
"github.com/mattermost/mattermost/server/v8/channels/store/storetest/mocks"
"github.com/mattermost/mattermost/server/v8/channels/testlib"
@@ -20,6 +21,7 @@ import (
)
type TestHelper struct {
Context *request.Context
Service *PlatformService
Suite SuiteIFace
@@ -52,7 +54,7 @@ func (ms *mockSuite) GetSession(token string) (*model.Session, *model.AppError)
return &model.Session{}, nil
}
func (ms *mockSuite) RolesGrantPermission(roleNames []string, permissionId string) bool { return true }
func (ms *mockSuite) UserCanSeeOtherUser(userID string, otherUserId string) (bool, *model.AppError) {
func (ms *mockSuite) UserCanSeeOtherUser(c request.CTX, userID string, otherUserId string) (bool, *model.AppError) {
return true, nil
}
@@ -158,6 +160,7 @@ func setupTestHelper(dbStore store.Store, enterprise bool, includeCacheLayer boo
}
th := &TestHelper{
Context: request.TestContext(tb),
Service: ps,
Suite: &mockSuite{},
}