Fixing nsfw unit tests
This commit is contained in:
parent
90676b16ad
commit
b44e7668a5
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,
|
||||
};
|
||||
|
||||
|
||||
|
@ -327,6 +332,7 @@ mod tests {
|
|||
None,
|
||||
None,
|
||||
Some(inserted_user.id),
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
None,
|
||||
|
@ -338,6 +344,7 @@ mod tests {
|
|||
None,
|
||||
None,
|
||||
None,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
None,
|
||||
|
|
Reference in a new issue