]> Untitled Git - lemmy.git/blobdiff - crates/apub/src/objects/comment.rs
Diesel 2.0.0 upgrade (#2452)
[lemmy.git] / crates / apub / src / objects / comment.rs
index 840d3a511e059ef4fab3f41aff533c56077790b6..41d7f19da0a28521fef7e47b706896c09b129f47 100644 (file)
@@ -249,16 +249,18 @@ pub(crate) mod tests {
   }
 
   fn cleanup(data: (ApubPerson, ApubCommunity, ApubPost, ApubSite), context: &LemmyContext) {
-    Post::delete(&*context.pool().get().unwrap(), data.2.id).unwrap();
-    Community::delete(&*context.pool().get().unwrap(), data.1.id).unwrap();
-    Person::delete(&*context.pool().get().unwrap(), data.0.id).unwrap();
-    Site::delete(&*context.pool().get().unwrap(), data.3.id).unwrap();
+    let conn = &mut context.pool().get().unwrap();
+    Post::delete(conn, data.2.id).unwrap();
+    Community::delete(conn, data.1.id).unwrap();
+    Person::delete(conn, data.0.id).unwrap();
+    Site::delete(conn, data.3.id).unwrap();
   }
 
   #[actix_rt::test]
   #[serial]
   pub(crate) async fn test_parse_lemmy_comment() {
     let context = init_context();
+    let conn = &mut context.pool().get().unwrap();
     let url = Url::parse("https://enterprise.lemmy.ml/comment/38741").unwrap();
     let data = prepare_comment_test(&url, &context).await;
 
@@ -280,7 +282,7 @@ pub(crate) mod tests {
     let to_apub = comment.into_apub(&context).await.unwrap();
     assert_json_include!(actual: json, expected: to_apub);
 
-    Comment::delete(&*context.pool().get().unwrap(), comment_id).unwrap();
+    Comment::delete(conn, comment_id).unwrap();
     cleanup(data, &context);
   }
 
@@ -288,6 +290,7 @@ pub(crate) mod tests {
   #[serial]
   async fn test_parse_pleroma_comment() {
     let context = init_context();
+    let conn = &mut context.pool().get().unwrap();
     let url = Url::parse("https://enterprise.lemmy.ml/comment/38741").unwrap();
     let data = prepare_comment_test(&url, &context).await;
 
@@ -315,7 +318,7 @@ pub(crate) mod tests {
     assert!(!comment.local);
     assert_eq!(request_counter, 0);
 
-    Comment::delete(&*context.pool().get().unwrap(), comment.id).unwrap();
+    Comment::delete(conn, comment.id).unwrap();
     cleanup(data, &context);
   }