Some formatting of post.rs

This commit is contained in:
Dessalines 2020-08-12 08:31:05 -04:00
parent aace1bd71e
commit 8ee6f852cb

View file

@ -1,4 +1,11 @@
use crate::{naive_now, schema::{post, post_like, post_read, post_saved}, Crud, Likeable, Saveable, Readable}; use crate::{
naive_now,
schema::{post, post_like, post_read, post_saved},
Crud,
Likeable,
Readable,
Saveable,
};
use diesel::{dsl::*, result::Error, *}; use diesel::{dsl::*, result::Error, *};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use url::{ParseError, Url}; use url::{ParseError, Url};
@ -430,17 +437,17 @@ mod tests {
// Post Read // Post Read
let post_read_form = PostReadForm { let post_read_form = PostReadForm {
post_id: inserted_post.id, post_id: inserted_post.id,
user_id: inserted_user.id, user_id: inserted_user.id,
}; };
let inserted_post_read = PostRead::mark_as_read(&conn, &post_read_form).unwrap(); let inserted_post_read = PostRead::mark_as_read(&conn, &post_read_form).unwrap();
let expected_post_read = PostRead { let expected_post_read = PostRead {
id: inserted_post_read.id, id: inserted_post_read.id,
post_id: inserted_post.id, post_id: inserted_post.id,
user_id: inserted_user.id, user_id: inserted_user.id,
published: inserted_post_read.published, published: inserted_post_read.published,
}; };
let read_post = Post::read(&conn, inserted_post.id).unwrap(); let read_post = Post::read(&conn, inserted_post.id).unwrap();