Update post_view.rs

This commit is contained in:
dullbananas 2023-12-20 16:01:18 -07:00 committed by GitHub
parent ef654b1472
commit 49ca4da763
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1446,7 +1446,7 @@ mod tests {
let inserted_community = Community::create(pool, &community_form).await.unwrap(); let inserted_community = Community::create(pool, &community_form).await.unwrap();
let mut inserted_post_ids = vec![]; let mut inserted_post_ids = vec![];
let mut comment_forms = vec![]; let mut inserted_comment_ids = vec![];
// Create 150 posts with varying non-correlating values for publish date, number of comments, and featured // Create 150 posts with varying non-correlating values for publish date, number of comments, and featured
for comments in 0..10 { for comments in 0..10 {
@ -1468,13 +1468,12 @@ mod tests {
.post_id(inserted_post.id) .post_id(inserted_post.id)
.content("yes".to_owned()) .content("yes".to_owned())
.build(); .build();
comment_forms.push((comment_form, None)); let inserted_comment = Comment::create(pool, &comment_form, None).await.unwrap();
inserted_comment_ids.push(inserted_comment.id);
} }
} }
} }
Comment::create_batch(pool, &comment_forms).await.unwrap();
let mut listed_post_ids = vec![]; let mut listed_post_ids = vec![];
let mut page_after = None; let mut page_after = None;
loop { loop {