diff --git a/plume-models/src/medias.rs b/plume-models/src/medias.rs index f4761461..1af5f3b6 100644 --- a/plume-models/src/medias.rs +++ b/plume-models/src/medias.rs @@ -400,7 +400,15 @@ pub(crate) mod tests { pub(crate) fn clean(conn: &Conn) { //used to remove files generated by tests for media in Media::list_all_medias(conn).unwrap() { - media.delete(conn).unwrap(); + if let Some(err) = media.delete(conn).err() { + match &err { + Error::Io(e) => match e.kind() { + std::io::ErrorKind::NotFound => (), + _ => panic!("{:?}", err), + }, + _ => panic!("{:?}", err), + } + } } }