Fixing nsfw unit tests

pull/722/head
Dessalines 2019-08-13 20:15:52 -07:00
parent 5b7ae1d6e3
commit d6046982e0
7 changed files with 37 additions and 16 deletions

View File

@ -46,7 +46,8 @@ mod tests {
published: naive_now(), published: naive_now(),
admin: false, admin: false,
banned: false, banned: false,
updated: None updated: None,
show_nsfw: false,
}; };
let person = expected_user.person(); let person = expected_user.person();

View File

@ -170,7 +170,8 @@ mod tests {
email: None, email: None,
admin: false, admin: false,
banned: false, banned: false,
updated: None updated: None,
show_nsfw: false,
}; };
let inserted_user = User_::create(&conn, &new_user).unwrap(); let inserted_user = User_::create(&conn, &new_user).unwrap();
@ -183,7 +184,8 @@ mod tests {
creator_id: inserted_user.id, creator_id: inserted_user.id,
removed: None, removed: None,
deleted: None, deleted: None,
updated: None updated: None,
nsfw: false,
}; };
let inserted_community = Community::create(&conn, &new_community).unwrap(); let inserted_community = Community::create(&conn, &new_community).unwrap();
@ -197,7 +199,8 @@ mod tests {
removed: None, removed: None,
deleted: None, deleted: None,
locked: None, locked: None,
updated: None updated: None,
nsfw: false,
}; };
let inserted_post = Post::create(&conn, &new_post).unwrap(); let inserted_post = Post::create(&conn, &new_post).unwrap();

View File

@ -261,7 +261,8 @@ mod tests {
email: None, email: None,
admin: false, admin: false,
banned: false, banned: false,
updated: None updated: None,
show_nsfw: false,
}; };
let inserted_user = User_::create(&conn, &new_user).unwrap(); let inserted_user = User_::create(&conn, &new_user).unwrap();
@ -274,7 +275,8 @@ mod tests {
creator_id: inserted_user.id, creator_id: inserted_user.id,
removed: None, removed: None,
deleted: None, deleted: None,
updated: None updated: None,
nsfw: false,
}; };
let inserted_community = Community::create(&conn, &new_community).unwrap(); let inserted_community = Community::create(&conn, &new_community).unwrap();
@ -288,7 +290,8 @@ mod tests {
removed: None, removed: None,
deleted: None, deleted: None,
locked: None, locked: None,
updated: None updated: None,
nsfw: false,
}; };
let inserted_post = Post::create(&conn, &new_post).unwrap(); let inserted_post = Post::create(&conn, &new_post).unwrap();

View File

@ -231,7 +231,8 @@ mod tests {
email: None, email: None,
admin: false, admin: false,
banned: false, banned: false,
updated: None updated: None,
show_nsfw: false,
}; };
let inserted_user = User_::create(&conn, &new_user).unwrap(); let inserted_user = User_::create(&conn, &new_user).unwrap();

View File

@ -412,7 +412,8 @@ mod tests {
email: None, email: None,
admin: false, admin: false,
banned: false, banned: false,
updated: None updated: None,
show_nsfw: false,
}; };
let inserted_mod = User_::create(&conn, &new_mod).unwrap(); let inserted_mod = User_::create(&conn, &new_mod).unwrap();
@ -425,7 +426,8 @@ mod tests {
email: None, email: None,
admin: false, admin: false,
banned: false, banned: false,
updated: None updated: None,
show_nsfw: false,
}; };
let inserted_user = User_::create(&conn, &new_user).unwrap(); let inserted_user = User_::create(&conn, &new_user).unwrap();
@ -438,7 +440,8 @@ mod tests {
creator_id: inserted_user.id, creator_id: inserted_user.id,
removed: None, removed: None,
deleted: None, deleted: None,
updated: None updated: None,
nsfw: false,
}; };
let inserted_community = Community::create(&conn, &new_community).unwrap(); let inserted_community = Community::create(&conn, &new_community).unwrap();
@ -452,7 +455,8 @@ mod tests {
removed: None, removed: None,
deleted: None, deleted: None,
locked: None, locked: None,
updated: None updated: None,
nsfw: false,
}; };
let inserted_post = Post::create(&conn, &new_post).unwrap(); let inserted_post = Post::create(&conn, &new_post).unwrap();

View File

@ -185,7 +185,8 @@ mod tests {
email: None, email: None,
admin: false, admin: false,
banned: false, banned: false,
updated: None updated: None,
show_nsfw: false,
}; };
let inserted_user = User_::create(&conn, &new_user).unwrap(); let inserted_user = User_::create(&conn, &new_user).unwrap();
@ -198,7 +199,8 @@ mod tests {
creator_id: inserted_user.id, creator_id: inserted_user.id,
removed: None, removed: None,
deleted: None, deleted: None,
updated: None updated: None,
nsfw: false,
}; };
let inserted_community = Community::create(&conn, &new_community).unwrap(); let inserted_community = Community::create(&conn, &new_community).unwrap();

View File

@ -208,6 +208,7 @@ mod tests {
updated: None, updated: None,
admin: false, admin: false,
banned: false, banned: false,
show_nsfw: false,
}; };
let inserted_user = User_::create(&conn, &new_user).unwrap(); let inserted_user = User_::create(&conn, &new_user).unwrap();
@ -220,7 +221,8 @@ mod tests {
category_id: 1, category_id: 1,
removed: None, removed: None,
deleted: None, deleted: None,
updated: None updated: None,
nsfw: false,
}; };
let inserted_community = Community::create(&conn, &new_community).unwrap(); let inserted_community = Community::create(&conn, &new_community).unwrap();
@ -234,7 +236,8 @@ mod tests {
removed: None, removed: None,
deleted: None, deleted: None,
locked: None, locked: None,
updated: None updated: None,
nsfw: false,
}; };
let inserted_post = Post::create(&conn, &new_post).unwrap(); let inserted_post = Post::create(&conn, &new_post).unwrap();
@ -289,6 +292,7 @@ mod tests {
subscribed: None, subscribed: None,
read: None, read: None,
saved: None, saved: None,
nsfw: false,
}; };
let expected_post_listing_with_user = PostView { let expected_post_listing_with_user = PostView {
@ -318,6 +322,7 @@ mod tests {
subscribed: None, subscribed: None,
read: None, read: None,
saved: None, saved: None,
nsfw: false,
}; };
@ -327,6 +332,7 @@ mod tests {
None, None,
None, None,
Some(inserted_user.id), Some(inserted_user.id),
false,
false, false,
false, false,
None, None,
@ -338,6 +344,7 @@ mod tests {
None, None,
None, None,
None, None,
false,
false, false,
false, false,
None, None,