* Add tear down to APIv4 tests

* Defer tear downs
Этот коммит содержится в:
Joram Wilander
2017-02-02 11:46:42 -05:00
коммит произвёл Harrison Healey
родитель 60be5c902f
Коммит 365514174e
13 изменённых файлов: 194 добавлений и 2 удалений

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

@@ -866,3 +866,19 @@ func ViewChannel(view *model.ChannelView, teamId string, userId string, clearPus
return nil
}
func PermanentDeleteChannel(channel *model.Channel) *model.AppError {
if result := <-Srv.Store.Post().PermanentDeleteByChannel(channel.Id); result.Err != nil {
return result.Err
}
if result := <-Srv.Store.Channel().PermanentDeleteMembersByChannel(channel.Id); result.Err != nil {
return result.Err
}
if result := <-Srv.Store.Channel().PermanentDelete(channel.Id); result.Err != nil {
return result.Err
}
return nil
}

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

@@ -539,8 +539,13 @@ func PermanentDeleteTeam(team *model.Team) *model.AppError {
return result.Err
}
if result := <-Srv.Store.Channel().PermanentDeleteByTeam(team.Id); result.Err != nil {
if result := <-Srv.Store.Channel().GetTeamChannels(team.Id); result.Err != nil {
return result.Err
} else {
channels := result.Data.(*model.ChannelList)
for _, c := range *channels {
PermanentDeleteChannel(c)
}
}
if result := <-Srv.Store.Team().RemoveAllMembersByTeam(team.Id); result.Err != nil {