mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-23 11:21:32 +00:00
Fixing nsfw unit tests
This commit is contained in:
parent
5b7ae1d6e3
commit
d6046982e0
7 changed files with 37 additions and 16 deletions
|
@ -46,7 +46,8 @@ mod tests {
|
|||
published: naive_now(),
|
||||
admin: false,
|
||||
banned: false,
|
||||
updated: None
|
||||
updated: None,
|
||||
show_nsfw: false,
|
||||
};
|
||||
|
||||
let person = expected_user.person();
|
||||
|
|
|
@ -170,7 +170,8 @@ mod tests {
|
|||
email: None,
|
||||
admin: false,
|
||||
banned: false,
|
||||
updated: None
|
||||
updated: None,
|
||||
show_nsfw: false,
|
||||
};
|
||||
|
||||
let inserted_user = User_::create(&conn, &new_user).unwrap();
|
||||
|
@ -183,7 +184,8 @@ mod tests {
|
|||
creator_id: inserted_user.id,
|
||||
removed: None,
|
||||
deleted: None,
|
||||
updated: None
|
||||
updated: None,
|
||||
nsfw: false,
|
||||
};
|
||||
|
||||
let inserted_community = Community::create(&conn, &new_community).unwrap();
|
||||
|
@ -197,7 +199,8 @@ mod tests {
|
|||
removed: None,
|
||||
deleted: None,
|
||||
locked: None,
|
||||
updated: None
|
||||
updated: None,
|
||||
nsfw: false,
|
||||
};
|
||||
|
||||
let inserted_post = Post::create(&conn, &new_post).unwrap();
|
||||
|
|
|
@ -261,7 +261,8 @@ mod tests {
|
|||
email: None,
|
||||
admin: false,
|
||||
banned: false,
|
||||
updated: None
|
||||
updated: None,
|
||||
show_nsfw: false,
|
||||
};
|
||||
|
||||
let inserted_user = User_::create(&conn, &new_user).unwrap();
|
||||
|
@ -274,7 +275,8 @@ mod tests {
|
|||
creator_id: inserted_user.id,
|
||||
removed: None,
|
||||
deleted: None,
|
||||
updated: None
|
||||
updated: None,
|
||||
nsfw: false,
|
||||
};
|
||||
|
||||
let inserted_community = Community::create(&conn, &new_community).unwrap();
|
||||
|
@ -288,7 +290,8 @@ mod tests {
|
|||
removed: None,
|
||||
deleted: None,
|
||||
locked: None,
|
||||
updated: None
|
||||
updated: None,
|
||||
nsfw: false,
|
||||
};
|
||||
|
||||
let inserted_post = Post::create(&conn, &new_post).unwrap();
|
||||
|
|
|
@ -231,7 +231,8 @@ mod tests {
|
|||
email: None,
|
||||
admin: false,
|
||||
banned: false,
|
||||
updated: None
|
||||
updated: None,
|
||||
show_nsfw: false,
|
||||
};
|
||||
|
||||
let inserted_user = User_::create(&conn, &new_user).unwrap();
|
||||
|
|
|
@ -412,7 +412,8 @@ mod tests {
|
|||
email: None,
|
||||
admin: false,
|
||||
banned: false,
|
||||
updated: None
|
||||
updated: None,
|
||||
show_nsfw: false,
|
||||
};
|
||||
|
||||
let inserted_mod = User_::create(&conn, &new_mod).unwrap();
|
||||
|
@ -425,7 +426,8 @@ mod tests {
|
|||
email: None,
|
||||
admin: false,
|
||||
banned: false,
|
||||
updated: None
|
||||
updated: None,
|
||||
show_nsfw: false,
|
||||
};
|
||||
|
||||
let inserted_user = User_::create(&conn, &new_user).unwrap();
|
||||
|
@ -438,7 +440,8 @@ mod tests {
|
|||
creator_id: inserted_user.id,
|
||||
removed: None,
|
||||
deleted: None,
|
||||
updated: None
|
||||
updated: None,
|
||||
nsfw: false,
|
||||
};
|
||||
|
||||
let inserted_community = Community::create(&conn, &new_community).unwrap();
|
||||
|
@ -452,7 +455,8 @@ mod tests {
|
|||
removed: None,
|
||||
deleted: None,
|
||||
locked: None,
|
||||
updated: None
|
||||
updated: None,
|
||||
nsfw: false,
|
||||
};
|
||||
|
||||
let inserted_post = Post::create(&conn, &new_post).unwrap();
|
||||
|
|
|
@ -185,7 +185,8 @@ mod tests {
|
|||
email: None,
|
||||
admin: false,
|
||||
banned: false,
|
||||
updated: None
|
||||
updated: None,
|
||||
show_nsfw: false,
|
||||
};
|
||||
|
||||
let inserted_user = User_::create(&conn, &new_user).unwrap();
|
||||
|
@ -198,7 +199,8 @@ mod tests {
|
|||
creator_id: inserted_user.id,
|
||||
removed: None,
|
||||
deleted: None,
|
||||
updated: None
|
||||
updated: None,
|
||||
nsfw: false,
|
||||
};
|
||||
|
||||
let inserted_community = Community::create(&conn, &new_community).unwrap();
|
||||
|
|
|
@ -208,6 +208,7 @@ mod tests {
|
|||
updated: None,
|
||||
admin: false,
|
||||
banned: false,
|
||||
show_nsfw: false,
|
||||
};
|
||||
|
||||
let inserted_user = User_::create(&conn, &new_user).unwrap();
|
||||
|
@ -220,7 +221,8 @@ mod tests {
|
|||
category_id: 1,
|
||||
removed: None,
|
||||
deleted: None,
|
||||
updated: None
|
||||
updated: None,
|
||||
nsfw: false,
|
||||
};
|
||||
|
||||
let inserted_community = Community::create(&conn, &new_community).unwrap();
|
||||
|
@ -234,7 +236,8 @@ mod tests {
|
|||
removed: None,
|
||||
deleted: None,
|
||||
locked: None,
|
||||
updated: None
|
||||
updated: None,
|
||||
nsfw: false,
|
||||
};
|
||||
|
||||
let inserted_post = Post::create(&conn, &new_post).unwrap();
|
||||
|
@ -289,6 +292,7 @@ mod tests {
|
|||
subscribed: None,
|
||||
read: None,
|
||||
saved: None,
|
||||
nsfw: false,
|
||||
};
|
||||
|
||||
let expected_post_listing_with_user = PostView {
|
||||
|
@ -318,6 +322,7 @@ mod tests {
|
|||
subscribed: None,
|
||||
read: None,
|
||||
saved: None,
|
||||
nsfw: false,
|
||||
};
|
||||
|
||||
|
||||
|
@ -329,6 +334,7 @@ mod tests {
|
|||
Some(inserted_user.id),
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
None,
|
||||
None).unwrap();
|
||||
let read_post_listings_no_user = PostView::list(&conn,
|
||||
|
@ -340,6 +346,7 @@ mod tests {
|
|||
None,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
None,
|
||||
None).unwrap();
|
||||
let read_post_listing_no_user = PostView::read(&conn, inserted_post.id, None).unwrap();
|
||||
|
|
Loading…
Reference in a new issue