From 33bd290679c77f9d3a4acc646a1f815e48ce7fd4 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Mon, 20 Mar 2023 01:21:39 +0900 Subject: [PATCH] Use DbConn in model tests --- plume-models/src/comments.rs | 1 + plume-models/src/follows.rs | 4 +++- plume-models/src/posts.rs | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plume-models/src/comments.rs b/plume-models/src/comments.rs index 2f06dada..91e7c6c2 100644 --- a/plume-models/src/comments.rs +++ b/plume-models/src/comments.rs @@ -422,6 +422,7 @@ impl CommentTree { mod tests { use super::*; use crate::blogs::Blog; + use crate::db_conn::DbConn; use crate::inbox::{inbox, tests::fill_database, InboxResult}; use crate::safe_string::SafeString; use crate::tests::{db, format_datetime}; diff --git a/plume-models/src/follows.rs b/plume-models/src/follows.rs index 8f79430b..f20bdd79 100644 --- a/plume-models/src/follows.rs +++ b/plume-models/src/follows.rs @@ -232,7 +232,9 @@ impl IntoId for Follow { #[cfg(test)] mod tests { use super::*; - use crate::{tests::db, users::tests as user_tests, users::tests::fill_database}; + use crate::{ + db_conn::DbConn, tests::db, users::tests as user_tests, users::tests::fill_database, + }; use assert_json_diff::assert_json_eq; use diesel::Connection; use serde_json::{json, to_value}; diff --git a/plume-models/src/posts.rs b/plume-models/src/posts.rs index d9a63c3b..80fdba32 100644 --- a/plume-models/src/posts.rs +++ b/plume-models/src/posts.rs @@ -1027,6 +1027,7 @@ impl From for Arc { #[cfg(test)] mod tests { use super::*; + use crate::db_conn::DbConn; use crate::inbox::{inbox, tests::fill_database, InboxResult}; use crate::mentions::{Mention, NewMention}; use crate::safe_string::SafeString;