diff --git a/plume-models/src/search/actor.rs b/plume-models/src/search/actor.rs index a0b0d22e..77dd8af7 100644 --- a/plume-models/src/search/actor.rs +++ b/plume-models/src/search/actor.rs @@ -151,11 +151,6 @@ mod tests { searcher.search_document(&conn, Query::from_str(&title).unwrap(), (0, 1))[0].id, post_id ); - // TODO: Make sure records are deleted even when assertion failed - post.delete(&conn).unwrap(); - blog.delete(&conn).unwrap(); - user.delete(&conn).unwrap(); - diesel::delete(&instance).execute(&conn).unwrap(); } fn fill_database(conn: &Conn) -> (Instance, User, Blog) { diff --git a/src/routes/blogs.rs b/src/routes/blogs.rs index 287dbdb4..bc0ffbfc 100644 --- a/src/routes/blogs.rs +++ b/src/routes/blogs.rs @@ -375,7 +375,7 @@ pub fn atom_feed(name: String, rockets: PlumeRocket) -> Option> #[cfg(test)] mod tests { use crate::init_rocket; - use diesel::{Connection, RunQueryDsl}; + use diesel::Connection; use plume_common::utils::random_hex; use plume_models::{ blog_authors::{BlogAuthor, NewBlogAuthor}, @@ -399,7 +399,7 @@ mod tests { let dbpool = client.rocket().state::().unwrap(); let conn = &DbConn(dbpool.get().unwrap()); - let (instance, user, blog, post) = create_models(conn); + let (_instance, user, blog, post) = create_models(conn); let blog_path = format!("/~/{}", blog.fqn); let edit_link = format!(r#"href="{}/{}/edit""#, blog_path, post.slug); @@ -413,13 +413,6 @@ mod tests { let mut response = request.dispatch(); let body = response.body_string().unwrap(); assert!(body.contains(&edit_link)); - - post.delete(conn).unwrap(); - blog.delete(conn).unwrap(); - user.delete(conn).unwrap(); - diesel::delete(&instance) - .execute(&dbpool.get().unwrap()) - .unwrap(); } fn create_models(conn: &DbConn) -> (Instance, User, Blog, Post) {