summaryrefslogtreecommitdiffstats
path: root/api/apitestlib.go
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2017-10-09 13:30:59 -0400
committerChris <ccbrown112@gmail.com>2017-10-09 10:30:59 -0700
commite522a1c2e49f5d21e45dd66f83d06e10fc3cdb67 (patch)
tree1c3f07497661fb18bdd6506ff3746777a09e0816 /api/apitestlib.go
parent9adaf53e110e0e806b21903111aacb93129668cb (diff)
downloadchat-e522a1c2e49f5d21e45dd66f83d06e10fc3cdb67.tar.gz
chat-e522a1c2e49f5d21e45dd66f83d06e10fc3cdb67.tar.bz2
chat-e522a1c2e49f5d21e45dd66f83d06e10fc3cdb67.zip
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
Diffstat (limited to 'api/apitestlib.go')
-rw-r--r--api/apitestlib.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/api/apitestlib.go b/api/apitestlib.go
index c0fd79ae9..3c64d2430 100644
--- a/api/apitestlib.go
+++ b/api/apitestlib.go
@@ -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()
}