mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
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:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user