PLT-7811 Standardized team sanitization flow (#7586)

* post-4.3 commit (#7581)

* reduce store boiler plate (#7585)

* fix GetPostsByIds error (#7591)

* PLT-7811 Standardized team sanitization flow

* Fixed TestGetAllTeamListings

* Stopped sanitizing teams for team admins

* Removed debug logging

* Added TearDown to sanitization tests that needed it
This commit is contained in:
Harrison Healey
2017-10-09 13:30:59 -04:00
committed by Chris
parent 9adaf53e11
commit e522a1c2e4
44 changed files with 1686 additions and 3304 deletions

View File

@@ -4,6 +4,7 @@
package api
import (
"strings"
"time"
"github.com/mattermost/mattermost-server/api4"
@@ -130,8 +131,8 @@ func (me *TestHelper) CreateTeam(client *model.Client) *model.Team {
id := model.NewId()
team := &model.Team{
DisplayName: "dn_" + id,
Name: "name" + id,
Email: "success+" + id + "@simulator.amazonses.com",
Name: GenerateTestTeamName(),
Email: GenerateTestEmail(),
Type: model.TEAM_OPEN,
}
@@ -308,6 +309,14 @@ func (me *TestHelper) LoginSystemAdmin() {
utils.EnableDebugLogForTest()
}
func GenerateTestEmail() string {
return strings.ToLower("success+" + model.NewId() + "@simulator.amazonses.com")
}
func GenerateTestTeamName() string {
return "faketeam" + model.NewRandomString(6)
}
func (me *TestHelper) TearDown() {
me.App.Shutdown()
}