diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2018-08-01 15:18:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-01 15:18:14 -0400 |
commit | c34b30a6e7fb707ae12e78a51e5bd776e5ca85ed (patch) | |
tree | 54a3a5d715fb0cf337c98a47efc4a75f7b23a791 /store/storetest/compliance_store.go | |
parent | a8cc646eede863e35eff3017f4472ec6f9ad01a4 (diff) | |
download | chat-c34b30a6e7fb707ae12e78a51e5bd776e5ca85ed.tar.gz chat-c34b30a6e7fb707ae12e78a51e5bd776e5ca85ed.tar.bz2 chat-c34b30a6e7fb707ae12e78a51e5bd776e5ca85ed.zip |
MM-11521/MM-11522 Fix being able to create users with invalid emails through API (#9199)
* MM-11522 Fix being able to create users with invalid emails through API
* Ensure store tests are using valid emails
* Add missing license header
* Remove invalid test case
* Fix TestUpdateOAuthUserAttrs
Diffstat (limited to 'store/storetest/compliance_store.go')
-rw-r--r-- | store/storetest/compliance_store.go | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/store/storetest/compliance_store.go b/store/storetest/compliance_store.go index 50a62531f..a772f6e44 100644 --- a/store/storetest/compliance_store.go +++ b/store/storetest/compliance_store.go @@ -78,18 +78,18 @@ func testComplianceExport(t *testing.T, ss store.Store) { t1 := &model.Team{} t1.DisplayName = "DisplayName" t1.Name = "zz" + model.NewId() + "b" - t1.Email = model.NewId() + "@nowhere.com" + t1.Email = MakeEmail() t1.Type = model.TEAM_OPEN t1 = store.Must(ss.Team().Save(t1)).(*model.Team) u1 := &model.User{} - u1.Email = model.NewId() + u1.Email = MakeEmail() u1.Username = model.NewId() u1 = store.Must(ss.User().Save(u1)).(*model.User) store.Must(ss.Team().SaveMember(&model.TeamMember{TeamId: t1.Id, UserId: u1.Id}, -1)) u2 := &model.User{} - u2.Email = model.NewId() + u2.Email = MakeEmail() u2.Username = model.NewId() u2 = store.Must(ss.User().Save(u2)).(*model.User) store.Must(ss.Team().SaveMember(&model.TeamMember{TeamId: t1.Id, UserId: u2.Id}, -1)) @@ -240,18 +240,18 @@ func testComplianceExportDirectMessages(t *testing.T, ss store.Store) { t1 := &model.Team{} t1.DisplayName = "DisplayName" t1.Name = "zz" + model.NewId() + "b" - t1.Email = model.NewId() + "@nowhere.com" + t1.Email = MakeEmail() t1.Type = model.TEAM_OPEN t1 = store.Must(ss.Team().Save(t1)).(*model.Team) u1 := &model.User{} - u1.Email = model.NewId() + u1.Email = MakeEmail() u1.Username = model.NewId() u1 = store.Must(ss.User().Save(u1)).(*model.User) store.Must(ss.Team().SaveMember(&model.TeamMember{TeamId: t1.Id, UserId: u1.Id}, -1)) u2 := &model.User{} - u2.Email = model.NewId() + u2.Email = MakeEmail() u2.Username = model.NewId() u2 = store.Must(ss.User().Save(u2)).(*model.User) store.Must(ss.Team().SaveMember(&model.TeamMember{TeamId: t1.Id, UserId: u2.Id}, -1)) @@ -337,14 +337,14 @@ func testMessageExportPublicChannel(t *testing.T, ss store.Store) { team := &model.Team{ DisplayName: "DisplayName", Name: "zz" + model.NewId() + "b", - Email: model.NewId() + "@nowhere.com", + Email: MakeEmail(), Type: model.TEAM_OPEN, } team = store.Must(ss.Team().Save(team)).(*model.Team) // and two users that are a part of that team user1 := &model.User{ - Email: model.NewId(), + Email: MakeEmail(), Username: model.NewId(), } user1 = store.Must(ss.User().Save(user1)).(*model.User) @@ -354,7 +354,7 @@ func testMessageExportPublicChannel(t *testing.T, ss store.Store) { }, -1)) user2 := &model.User{ - Email: model.NewId(), + Email: MakeEmail(), Username: model.NewId(), } user2 = store.Must(ss.User().Save(user2)).(*model.User) @@ -438,14 +438,14 @@ func testMessageExportPrivateChannel(t *testing.T, ss store.Store) { team := &model.Team{ DisplayName: "DisplayName", Name: "zz" + model.NewId() + "b", - Email: model.NewId() + "@nowhere.com", + Email: MakeEmail(), Type: model.TEAM_OPEN, } team = store.Must(ss.Team().Save(team)).(*model.Team) // and two users that are a part of that team user1 := &model.User{ - Email: model.NewId(), + Email: MakeEmail(), Username: model.NewId(), } user1 = store.Must(ss.User().Save(user1)).(*model.User) @@ -455,7 +455,7 @@ func testMessageExportPrivateChannel(t *testing.T, ss store.Store) { }, -1)) user2 := &model.User{ - Email: model.NewId(), + Email: MakeEmail(), Username: model.NewId(), } user2 = store.Must(ss.User().Save(user2)).(*model.User) @@ -541,14 +541,14 @@ func testMessageExportDirectMessageChannel(t *testing.T, ss store.Store) { team := &model.Team{ DisplayName: "DisplayName", Name: "zz" + model.NewId() + "b", - Email: model.NewId() + "@nowhere.com", + Email: MakeEmail(), Type: model.TEAM_OPEN, } team = store.Must(ss.Team().Save(team)).(*model.Team) // and two users that are a part of that team user1 := &model.User{ - Email: model.NewId(), + Email: MakeEmail(), Username: model.NewId(), } user1 = store.Must(ss.User().Save(user1)).(*model.User) @@ -558,7 +558,7 @@ func testMessageExportDirectMessageChannel(t *testing.T, ss store.Store) { }, -1)) user2 := &model.User{ - Email: model.NewId(), + Email: MakeEmail(), Username: model.NewId(), } user2 = store.Must(ss.User().Save(user2)).(*model.User) @@ -619,14 +619,14 @@ func testMessageExportGroupMessageChannel(t *testing.T, ss store.Store) { team := &model.Team{ DisplayName: "DisplayName", Name: "zz" + model.NewId() + "b", - Email: model.NewId() + "@nowhere.com", + Email: MakeEmail(), Type: model.TEAM_OPEN, } team = store.Must(ss.Team().Save(team)).(*model.Team) // and three users that are a part of that team user1 := &model.User{ - Email: model.NewId(), + Email: MakeEmail(), Username: model.NewId(), } user1 = store.Must(ss.User().Save(user1)).(*model.User) @@ -636,7 +636,7 @@ func testMessageExportGroupMessageChannel(t *testing.T, ss store.Store) { }, -1)) user2 := &model.User{ - Email: model.NewId(), + Email: MakeEmail(), Username: model.NewId(), } user2 = store.Must(ss.User().Save(user2)).(*model.User) @@ -646,7 +646,7 @@ func testMessageExportGroupMessageChannel(t *testing.T, ss store.Store) { }, -1)) user3 := &model.User{ - Email: model.NewId(), + Email: MakeEmail(), Username: model.NewId(), } user3 = store.Must(ss.User().Save(user3)).(*model.User) |