Commit 75f8729e authored by =Corey Hulen's avatar =Corey Hulen

PLT-7 adding loc db calls for users table

parent aac8d121
...@@ -128,7 +128,7 @@ func testEmail(c *Context, w http.ResponseWriter, r *http.Request) { ...@@ -128,7 +128,7 @@ func testEmail(c *Context, w http.ResponseWriter, r *http.Request) {
return return
} }
if result := <-Srv.Store.User().Get(c.Session.UserId); result.Err != nil { if result := <-Srv.Store.User().Get(c.T, c.Session.UserId); result.Err != nil {
c.Err = result.Err c.Err = result.Err
return return
} else { } else {
......
...@@ -19,7 +19,7 @@ func TestGetLogs(t *testing.T) { ...@@ -19,7 +19,7 @@ func TestGetLogs(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User) user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd") Client.LoginByEmail(team.Name, user.Email, "pwd")
...@@ -63,7 +63,7 @@ func TestGetConfig(t *testing.T) { ...@@ -63,7 +63,7 @@ func TestGetConfig(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User) user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd") Client.LoginByEmail(team.Name, user.Email, "pwd")
...@@ -97,7 +97,7 @@ func TestSaveConfig(t *testing.T) { ...@@ -97,7 +97,7 @@ func TestSaveConfig(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User) user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd") Client.LoginByEmail(team.Name, user.Email, "pwd")
...@@ -131,7 +131,7 @@ func TestEmailTest(t *testing.T) { ...@@ -131,7 +131,7 @@ func TestEmailTest(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User) user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd") Client.LoginByEmail(team.Name, user.Email, "pwd")
...@@ -159,7 +159,7 @@ func TestGetAnalyticsStandard(t *testing.T) { ...@@ -159,7 +159,7 @@ func TestGetAnalyticsStandard(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User) user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd") Client.LoginByEmail(team.Name, user.Email, "pwd")
...@@ -225,7 +225,7 @@ func TestGetPostCount(t *testing.T) { ...@@ -225,7 +225,7 @@ func TestGetPostCount(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User) user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd") Client.LoginByEmail(team.Name, user.Email, "pwd")
...@@ -270,7 +270,7 @@ func TestUserCountsWithPostsByDay(t *testing.T) { ...@@ -270,7 +270,7 @@ func TestUserCountsWithPostsByDay(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User) user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd") Client.LoginByEmail(team.Name, user.Email, "pwd")
......
...@@ -31,7 +31,7 @@ func SetupBenchmark() (*model.Team, *model.User, *model.Channel) { ...@@ -31,7 +31,7 @@ func SetupBenchmark() (*model.Team, *model.User, *model.Channel) {
team = Client.Must(Client.CreateTeam(team)).Data.(*model.Team) team = Client.Must(Client.CreateTeam(team)).Data.(*model.Team)
user := &model.User{TeamId: team.Id, Email: model.NewId() + "benchmark@test.com", Nickname: "Mr. Benchmarker", Password: "pwd"} user := &model.User{TeamId: team.Id, Email: model.NewId() + "benchmark@test.com", Nickname: "Mr. Benchmarker", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User) user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd") Client.LoginByEmail(team.Name, user.Email, "pwd")
channel := &model.Channel{DisplayName: "Benchmark Channel", Name: "a" + model.NewId() + "a", Type: model.CHANNEL_OPEN, TeamId: team.Id} channel := &model.Channel{DisplayName: "Benchmark Channel", Name: "a" + model.NewId() + "a", Type: model.CHANNEL_OPEN, TeamId: team.Id}
channel = Client.Must(Client.CreateChannel(channel)).Data.(*model.Channel) channel = Client.Must(Client.CreateChannel(channel)).Data.(*model.Channel)
......
...@@ -46,7 +46,7 @@ func CreateBasicUser(client *model.Client) *model.AppError { ...@@ -46,7 +46,7 @@ func CreateBasicUser(client *model.Client) *model.AppError {
if err != nil { if err != nil {
return err return err
} }
store.Must(Srv.Store.User().VerifyEmail(result.Data.(*model.User).Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, result.Data.(*model.User).Id))
} }
return nil return nil
} }
...@@ -73,7 +73,7 @@ func (cfg *AutoUserCreator) createRandomUser() (*model.User, bool) { ...@@ -73,7 +73,7 @@ func (cfg *AutoUserCreator) createRandomUser() (*model.User, bool) {
return nil, false return nil, false
} }
// We need to cheat to verify the user's email // We need to cheat to verify the user's email
store.Must(Srv.Store.User().VerifyEmail(result.Data.(*model.User).Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, result.Data.(*model.User).Id))
return result.Data.(*model.User), true return result.Data.(*model.User), true
} }
......
...@@ -125,7 +125,7 @@ func CreateDirectChannel(c *Context, otherUserId string) (*model.Channel, *model ...@@ -125,7 +125,7 @@ func CreateDirectChannel(c *Context, otherUserId string) (*model.Channel, *model
return nil, model.NewAppError("CreateDirectChannel", "Invalid other user id ", otherUserId) return nil, model.NewAppError("CreateDirectChannel", "Invalid other user id ", otherUserId)
} }
uc := Srv.Store.User().Get(otherUserId) uc := Srv.Store.User().Get(c.T, otherUserId)
channel := new(model.Channel) channel := new(model.Channel)
...@@ -292,7 +292,7 @@ func updateChannelHeader(c *Context, w http.ResponseWriter, r *http.Request) { ...@@ -292,7 +292,7 @@ func updateChannelHeader(c *Context, w http.ResponseWriter, r *http.Request) {
func PostUpdateChannelHeaderMessageAndForget(c *Context, channelId string, oldChannelHeader, newChannelHeader string) { func PostUpdateChannelHeaderMessageAndForget(c *Context, channelId string, oldChannelHeader, newChannelHeader string) {
go func() { go func() {
uc := Srv.Store.User().Get(c.Session.UserId) uc := Srv.Store.User().Get(c.T, c.Session.UserId)
if uresult := <-uc; uresult.Err != nil { if uresult := <-uc; uresult.Err != nil {
l4g.Error("Failed to retrieve user while trying to save update channel header message %v", uresult.Err) l4g.Error("Failed to retrieve user while trying to save update channel header message %v", uresult.Err)
...@@ -371,7 +371,7 @@ func getChannels(c *Context, w http.ResponseWriter, r *http.Request) { ...@@ -371,7 +371,7 @@ func getChannels(c *Context, w http.ResponseWriter, r *http.Request) {
if result := <-Srv.Store.Channel().GetChannels(c.T, c.Session.TeamId, c.Session.UserId); result.Err != nil { if result := <-Srv.Store.Channel().GetChannels(c.T, c.Session.TeamId, c.Session.UserId); result.Err != nil {
if result.Err.Message == "No channels were found" { if result.Err.Message == "No channels were found" {
// lets make sure the user is valid // lets make sure the user is valid
if result := <-Srv.Store.User().Get(c.Session.UserId); result.Err != nil { if result := <-Srv.Store.User().Get(c.T, c.Session.UserId); result.Err != nil {
c.Err = result.Err c.Err = result.Err
c.RemoveSessionCookie(w, r) c.RemoveSessionCookie(w, r)
l4g.Error("Error in getting users profile for id=%v forcing logout", c.Session.UserId) l4g.Error("Error in getting users profile for id=%v forcing logout", c.Session.UserId)
...@@ -440,7 +440,7 @@ func join(c *Context, w http.ResponseWriter, r *http.Request) { ...@@ -440,7 +440,7 @@ func join(c *Context, w http.ResponseWriter, r *http.Request) {
func JoinChannel(c *Context, channelId string, role string) { func JoinChannel(c *Context, channelId string, role string) {
sc := Srv.Store.Channel().Get(c.T, channelId) sc := Srv.Store.Channel().Get(c.T, channelId)
uc := Srv.Store.User().Get(c.Session.UserId) uc := Srv.Store.User().Get(c.T, c.Session.UserId)
if cresult := <-sc; cresult.Err != nil { if cresult := <-sc; cresult.Err != nil {
c.Err = cresult.Err c.Err = cresult.Err
...@@ -544,7 +544,7 @@ func leave(c *Context, w http.ResponseWriter, r *http.Request) { ...@@ -544,7 +544,7 @@ func leave(c *Context, w http.ResponseWriter, r *http.Request) {
id := params["id"] id := params["id"]
sc := Srv.Store.Channel().Get(c.T, id) sc := Srv.Store.Channel().Get(c.T, id)
uc := Srv.Store.User().Get(c.Session.UserId) uc := Srv.Store.User().Get(c.T, c.Session.UserId)
if cresult := <-sc; cresult.Err != nil { if cresult := <-sc; cresult.Err != nil {
c.Err = cresult.Err c.Err = cresult.Err
...@@ -594,7 +594,7 @@ func deleteChannel(c *Context, w http.ResponseWriter, r *http.Request) { ...@@ -594,7 +594,7 @@ func deleteChannel(c *Context, w http.ResponseWriter, r *http.Request) {
sc := Srv.Store.Channel().Get(c.T, id) sc := Srv.Store.Channel().Get(c.T, id)
scm := Srv.Store.Channel().GetMember(c.T, id, c.Session.UserId) scm := Srv.Store.Channel().GetMember(c.T, id, c.Session.UserId)
uc := Srv.Store.User().Get(c.Session.UserId) uc := Srv.Store.User().Get(c.T, c.Session.UserId)
ihc := Srv.Store.Webhook().GetIncomingByChannel(c.T, id) ihc := Srv.Store.Webhook().GetIncomingByChannel(c.T, id)
ohc := Srv.Store.Webhook().GetOutgoingByChannel(c.T, id) ohc := Srv.Store.Webhook().GetOutgoingByChannel(c.T, id)
...@@ -818,8 +818,8 @@ func addMember(c *Context, w http.ResponseWriter, r *http.Request) { ...@@ -818,8 +818,8 @@ func addMember(c *Context, w http.ResponseWriter, r *http.Request) {
cchan := Srv.Store.Channel().CheckPermissionsTo(c.T, c.Session.TeamId, id, c.Session.UserId) cchan := Srv.Store.Channel().CheckPermissionsTo(c.T, c.Session.TeamId, id, c.Session.UserId)
sc := Srv.Store.Channel().Get(c.T, id) sc := Srv.Store.Channel().Get(c.T, id)
ouc := Srv.Store.User().Get(c.Session.UserId) ouc := Srv.Store.User().Get(c.T, c.Session.UserId)
nuc := Srv.Store.User().Get(userId) nuc := Srv.Store.User().Get(c.T, userId)
// Only need to be a member of the channel to add a new member // Only need to be a member of the channel to add a new member
if !c.HasPermissionsToChannel(cchan, "addMember") { if !c.HasPermissionsToChannel(cchan, "addMember") {
......
...@@ -140,7 +140,7 @@ func BenchmarkJoinChannel(b *testing.B) { ...@@ -140,7 +140,7 @@ func BenchmarkJoinChannel(b *testing.B) {
// Secondary test user to join channels created by primary test user // Secondary test user to join channels created by primary test user
user := &model.User{TeamId: team.Id, Email: model.NewId() + "random@test.com", Nickname: "That Guy", Password: "pwd"} user := &model.User{TeamId: team.Id, Email: model.NewId() + "random@test.com", Nickname: "That Guy", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User) user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd") Client.LoginByEmail(team.Name, user.Email, "pwd")
// Benchmark Start // Benchmark Start
......
...@@ -24,7 +24,7 @@ func TestCreateChannel(t *testing.T) { ...@@ -24,7 +24,7 @@ func TestCreateChannel(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User) user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd") Client.LoginByEmail(team.Name, user.Email, "pwd")
...@@ -101,11 +101,11 @@ func TestCreateDirectChannel(t *testing.T) { ...@@ -101,11 +101,11 @@ func TestCreateDirectChannel(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User) user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
user2 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user2 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user2 = Client.Must(Client.CreateUser(user2, "")).Data.(*model.User) user2 = Client.Must(Client.CreateUser(user2, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user2.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user2.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd") Client.LoginByEmail(team.Name, user.Email, "pwd")
...@@ -156,15 +156,15 @@ func TestUpdateChannel(t *testing.T) { ...@@ -156,15 +156,15 @@ func TestUpdateChannel(t *testing.T) {
userTeamAdmin := &model.User{TeamId: team.Id, Email: team.Email, Nickname: "Corey Hulen", Password: "pwd"} userTeamAdmin := &model.User{TeamId: team.Id, Email: team.Email, Nickname: "Corey Hulen", Password: "pwd"}
userTeamAdmin = Client.Must(Client.CreateUser(userTeamAdmin, "")).Data.(*model.User) userTeamAdmin = Client.Must(Client.CreateUser(userTeamAdmin, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(userTeamAdmin.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, userTeamAdmin.Id))
userChannelAdmin := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} userChannelAdmin := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
userChannelAdmin = Client.Must(Client.CreateUser(userChannelAdmin, "")).Data.(*model.User) userChannelAdmin = Client.Must(Client.CreateUser(userChannelAdmin, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(userChannelAdmin.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, userChannelAdmin.Id))
userStd := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} userStd := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
userStd = Client.Must(Client.CreateUser(userStd, "")).Data.(*model.User) userStd = Client.Must(Client.CreateUser(userStd, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(userStd.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, userStd.Id))
userStd.Roles = "" userStd.Roles = ""
Client.LoginByEmail(team.Name, userChannelAdmin.Email, "pwd") Client.LoginByEmail(team.Name, userChannelAdmin.Email, "pwd")
...@@ -238,7 +238,7 @@ func TestUpdateChannelHeader(t *testing.T) { ...@@ -238,7 +238,7 @@ func TestUpdateChannelHeader(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User) user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd") Client.LoginByEmail(team.Name, user.Email, "pwd")
...@@ -278,7 +278,7 @@ func TestUpdateChannelHeader(t *testing.T) { ...@@ -278,7 +278,7 @@ func TestUpdateChannelHeader(t *testing.T) {
user2 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user2 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user2 = Client.Must(Client.CreateUser(user2, "")).Data.(*model.User) user2 = Client.Must(Client.CreateUser(user2, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user2.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user2.Id))
Client.LoginByEmail(team.Name, user2.Email, "pwd") Client.LoginByEmail(team.Name, user2.Email, "pwd")
...@@ -297,7 +297,7 @@ func TestUpdateChannelPurpose(t *testing.T) { ...@@ -297,7 +297,7 @@ func TestUpdateChannelPurpose(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User) user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd") Client.LoginByEmail(team.Name, user.Email, "pwd")
...@@ -337,7 +337,7 @@ func TestUpdateChannelPurpose(t *testing.T) { ...@@ -337,7 +337,7 @@ func TestUpdateChannelPurpose(t *testing.T) {
user2 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user2 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user2 = Client.Must(Client.CreateUser(user2, "")).Data.(*model.User) user2 = Client.Must(Client.CreateUser(user2, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user2.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user2.Id))
Client.LoginByEmail(team.Name, user2.Email, "pwd") Client.LoginByEmail(team.Name, user2.Email, "pwd")
...@@ -356,7 +356,7 @@ func TestGetChannel(t *testing.T) { ...@@ -356,7 +356,7 @@ func TestGetChannel(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User) user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd") Client.LoginByEmail(team.Name, user.Email, "pwd")
...@@ -419,7 +419,7 @@ func TestGetMoreChannel(t *testing.T) { ...@@ -419,7 +419,7 @@ func TestGetMoreChannel(t *testing.T) {
user1 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user1 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user1 = Client.Must(Client.CreateUser(user1, "")).Data.(*model.User) user1 = Client.Must(Client.CreateUser(user1, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user1.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user1.Id))
Client.LoginByEmail(team.Name, user1.Email, "pwd") Client.LoginByEmail(team.Name, user1.Email, "pwd")
...@@ -431,7 +431,7 @@ func TestGetMoreChannel(t *testing.T) { ...@@ -431,7 +431,7 @@ func TestGetMoreChannel(t *testing.T) {
user2 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user2 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user2 = Client.Must(Client.CreateUser(user2, "")).Data.(*model.User) user2 = Client.Must(Client.CreateUser(user2, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user2.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user2.Id))
Client.LoginByEmail(team.Name, user2.Email, "pwd") Client.LoginByEmail(team.Name, user2.Email, "pwd")
...@@ -463,7 +463,7 @@ func TestGetChannelCounts(t *testing.T) { ...@@ -463,7 +463,7 @@ func TestGetChannelCounts(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User) user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd") Client.LoginByEmail(team.Name, user.Email, "pwd")
...@@ -504,7 +504,7 @@ func TestJoinChannel(t *testing.T) { ...@@ -504,7 +504,7 @@ func TestJoinChannel(t *testing.T) {
user1 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user1 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user1 = Client.Must(Client.CreateUser(user1, "")).Data.(*model.User) user1 = Client.Must(Client.CreateUser(user1, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user1.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user1.Id))
Client.LoginByEmail(team.Name, user1.Email, "pwd") Client.LoginByEmail(team.Name, user1.Email, "pwd")
...@@ -516,7 +516,7 @@ func TestJoinChannel(t *testing.T) { ...@@ -516,7 +516,7 @@ func TestJoinChannel(t *testing.T) {
user2 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user2 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user2 = Client.Must(Client.CreateUser(user2, "")).Data.(*model.User) user2 = Client.Must(Client.CreateUser(user2, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user2.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user2.Id))
Client.LoginByEmail(team.Name, user2.Email, "pwd") Client.LoginByEmail(team.Name, user2.Email, "pwd")
...@@ -548,7 +548,7 @@ func TestLeaveChannel(t *testing.T) { ...@@ -548,7 +548,7 @@ func TestLeaveChannel(t *testing.T) {
user1 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user1 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user1 = Client.Must(Client.CreateUser(user1, "")).Data.(*model.User) user1 = Client.Must(Client.CreateUser(user1, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user1.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user1.Id))
Client.LoginByEmail(team.Name, user1.Email, "pwd") Client.LoginByEmail(team.Name, user1.Email, "pwd")
...@@ -560,7 +560,7 @@ func TestLeaveChannel(t *testing.T) { ...@@ -560,7 +560,7 @@ func TestLeaveChannel(t *testing.T) {
user2 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user2 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user2 = Client.Must(Client.CreateUser(user2, "")).Data.(*model.User) user2 = Client.Must(Client.CreateUser(user2, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user2.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user2.Id))
Client.LoginByEmail(team.Name, user2.Email, "pwd") Client.LoginByEmail(team.Name, user2.Email, "pwd")
...@@ -597,11 +597,11 @@ func TestDeleteChannel(t *testing.T) { ...@@ -597,11 +597,11 @@ func TestDeleteChannel(t *testing.T) {
userTeamAdmin := &model.User{TeamId: team.Id, Email: team.Email, Nickname: "Corey Hulen", Password: "pwd"} userTeamAdmin := &model.User{TeamId: team.Id, Email: team.Email, Nickname: "Corey Hulen", Password: "pwd"}
userTeamAdmin = Client.Must(Client.CreateUser(userTeamAdmin, "")).Data.(*model.User) userTeamAdmin = Client.Must(Client.CreateUser(userTeamAdmin, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(userTeamAdmin.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, userTeamAdmin.Id))
userChannelAdmin := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} userChannelAdmin := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
userChannelAdmin = Client.Must(Client.CreateUser(userChannelAdmin, "")).Data.(*model.User) userChannelAdmin = Client.Must(Client.CreateUser(userChannelAdmin, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(userChannelAdmin.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, userChannelAdmin.Id))
Client.LoginByEmail(team.Name, userChannelAdmin.Email, "pwd") Client.LoginByEmail(team.Name, userChannelAdmin.Email, "pwd")
...@@ -633,7 +633,7 @@ func TestDeleteChannel(t *testing.T) { ...@@ -633,7 +633,7 @@ func TestDeleteChannel(t *testing.T) {
userStd := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} userStd := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
userStd = Client.Must(Client.CreateUser(userStd, "")).Data.(*model.User) userStd = Client.Must(Client.CreateUser(userStd, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(userStd.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, userStd.Id))
Client.LoginByEmail(team.Name, userStd.Email, "pwd") Client.LoginByEmail(team.Name, userStd.Email, "pwd")
...@@ -667,7 +667,7 @@ func TestGetChannelExtraInfo(t *testing.T) { ...@@ -667,7 +667,7 @@ func TestGetChannelExtraInfo(t *testing.T) {
user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User) user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user.Id))
Client.LoginByEmail(team.Name, user.Email, "pwd") Client.LoginByEmail(team.Name, user.Email, "pwd")
...@@ -703,7 +703,7 @@ func TestGetChannelExtraInfo(t *testing.T) { ...@@ -703,7 +703,7 @@ func TestGetChannelExtraInfo(t *testing.T) {
user2 := &model.User{TeamId: team.Id, Email: model.NewId() + "tester2@test.com", Nickname: "Tester 2", Password: "pwd"} user2 := &model.User{TeamId: team.Id, Email: model.NewId() + "tester2@test.com", Nickname: "Tester 2", Password: "pwd"}
user2 = Client2.Must(Client2.CreateUser(user2, "")).Data.(*model.User) user2 = Client2.Must(Client2.CreateUser(user2, "")).Data.(*model.User)
store.Must(Srv.Store.User().VerifyEmail(user2.Id)) store.Must(Srv.Store.User().VerifyEmail(utils.T, user2.Id))
Client2.LoginByEmail(team.Name, user2.Email, "pwd") Client2.LoginByEmail(team.Name, user2.Email, "pwd")
Client2.Must(Client2.JoinChannel(channel1.Id)) Client2.Must(Client2.JoinChannel(channel1.Id))
...@@ -791,7 +791,7 @@ func TestAddChannelMember(t *testing.T) { ...@@ -791,7 +791,7 @@ func TestAddChannelMember(t *testing.T) {
user1 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"} user1 := &model.User{TeamId: team.Id, Email: model.NewId() + "corey+test@test.com", Nickname: "Corey Hulen", Password: "pwd"}
user1 = Client.Must(Client.CreateUser(user1, "")).Data.(*model.User)