PLT-7288: Allow CLI to delete teams with no channels. (#7135)

Этот коммит содержится в:
George Goldberg
2017-08-09 21:36:27 +01:00
коммит произвёл Christopher Speller
родитель ff0811e4a4
Коммит ab13de96a0
2 изменённых файлов: 23 добавлений и 1 удалений

Просмотреть файл

@@ -152,4 +152,24 @@ func TestPermanentDeleteTeam(t *testing.T) {
if command, err = GetCommand(command.Id); command != nil || err == nil {
t.Fatal("command wasn't deleted")
}
// Test deleting a team with no channels.
team = th.CreateTeam()
defer func() {
PermanentDeleteTeam(team)
}()
if channels, err := GetPublicChannelsForTeam(team.Id, 0, 1000); err != nil {
t.Fatal(err)
} else {
for _, channel := range *channels {
if err2 := PermanentDeleteChannel(channel); err2 != nil {
t.Fatal(err)
}
}
}
if err := PermanentDeleteTeam(team); err != nil {
t.Fatal(err)
}
}