MCPcopy
hub / github.com/mattermost/mattermost / InitBasic

Method InitBasic

server/channels/app/helper_test.go:310–332  ·  view source on GitHub ↗
(tb testing.TB)

Source from the content-addressed store, hash-verified

308}
309
310func (th *TestHelper) InitBasic(tb testing.TB) *TestHelper {
311 th.SystemAdminUser = th.CreateUser(tb)
312 _, appErr := th.App.UpdateUserRoles(th.Context, th.SystemAdminUser.Id, model.SystemUserRoleId+" "+model.SystemAdminRoleId, false)
313 require.Nil(tb, appErr)
314 th.SystemAdminUser, appErr = th.App.GetUser(th.SystemAdminUser.Id)
315 require.Nil(tb, appErr)
316
317 th.BasicUser = th.CreateUser(tb)
318 th.BasicUser, appErr = th.App.GetUser(th.BasicUser.Id)
319 require.Nil(tb, appErr)
320
321 th.BasicUser2 = th.CreateUser(tb)
322 th.BasicUser2, appErr = th.App.GetUser(th.BasicUser2.Id)
323 require.Nil(tb, appErr)
324
325 th.BasicTeam = th.CreateTeam(tb)
326
327 th.LinkUserToTeam(tb, th.BasicUser, th.BasicTeam)
328 th.LinkUserToTeam(tb, th.BasicUser2, th.BasicTeam)
329 th.BasicChannel = th.CreateChannel(tb, th.BasicTeam)
330 th.BasicPost = th.CreatePost(tb, th.BasicChannel)
331 return th
332}
333
334func (th *TestHelper) DeleteBots(tb testing.TB) *TestHelper {
335 preexistingBots, _ := th.App.GetBots(th.Context, &model.BotGetOptions{Page: 0, PerPage: 100})

Callers 15

TestGetServerLimitsFunction · 0.45
TestIsAtUserLimitFunction · 0.45
TestExtraUsersBehaviorFunction · 0.45
TestGetPostHistoryLimitFunction · 0.45
TestUserTermsOfServiceFunction · 0.45
TestGetDraftFunction · 0.45
TestUpsertDraftFunction · 0.45
TestCreateDraftFunction · 0.45
TestUpdateDraftFunction · 0.45

Calls 7

CreateUserMethod · 0.95
CreateTeamMethod · 0.95
LinkUserToTeamMethod · 0.95
CreateChannelMethod · 0.95
CreatePostMethod · 0.95
UpdateUserRolesMethod · 0.65
GetUserMethod · 0.65

Tested by

no test coverage detected