Add unit tests for main model parts (#310)
Add tests for following models: - Blog - Instance - Media - User
This commit is contained in:
committed by
Baptiste Gelez
parent
0b9727ed28
commit
8a4702df92
@@ -1,8 +1,8 @@
|
||||
use diesel::{self, QueryDsl, RunQueryDsl, ExpressionMethods};
|
||||
use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl};
|
||||
|
||||
use posts::Post;
|
||||
use users::User;
|
||||
use schema::post_authors;
|
||||
use users::User;
|
||||
|
||||
#[derive(Clone, Queryable, Identifiable, Associations)]
|
||||
#[belongs_to(Post)]
|
||||
@@ -10,14 +10,14 @@ use schema::post_authors;
|
||||
pub struct PostAuthor {
|
||||
pub id: i32,
|
||||
pub post_id: i32,
|
||||
pub author_id: i32
|
||||
pub author_id: i32,
|
||||
}
|
||||
|
||||
#[derive(Insertable)]
|
||||
#[table_name = "post_authors"]
|
||||
pub struct NewPostAuthor {
|
||||
pub post_id: i32,
|
||||
pub author_id: i32
|
||||
pub author_id: i32,
|
||||
}
|
||||
|
||||
impl PostAuthor {
|
||||
|
||||
Reference in New Issue
Block a user