+ assert_eq!(expected_post_listing_with_user, read_post_listing[0]);
+ expected_post_listing_with_user.my_vote = Some(0);
+ assert_eq!(
+ expected_post_listing_with_user,
+ post_listing_single_with_person
+ );
+
+ let local_user_form = LocalUserUpdateForm::builder()
+ .show_bot_accounts(Some(true))
+ .build();
+ let inserted_local_user =
+ LocalUser::update(pool, data.local_user_view.local_user.id, &local_user_form)
+ .await
+ .unwrap();
+ data.local_user_view.local_user = inserted_local_user;
+
+ let post_listings_with_bots = PostQuery {
+ sort: (Some(SortType::New)),
+ community_id: (Some(data.inserted_community.id)),
+ local_user: (Some(&data.local_user_view)),
+ ..Default::default()
+ }
+ .list(pool)
+ .await
+ .unwrap();
+ // should include bot post which has "undetermined" language
+ assert_eq!(2, post_listings_with_bots.len());
+
+ cleanup(data, pool).await;
+ }
+
+ #[tokio::test]
+ #[serial]
+ async fn post_listing_no_person() {
+ let pool = &build_db_pool_for_tests().await;
+ let pool = &mut pool.into();
+ let data = init_data(pool).await;
+
+ let read_post_listing_multiple_no_person = PostQuery {
+ sort: (Some(SortType::New)),
+ community_id: (Some(data.inserted_community.id)),
+ ..Default::default()
+ }
+ .list(pool)
+ .await
+ .unwrap();
+
+ let read_post_listing_single_no_person =
+ PostView::read(pool, data.inserted_post.id, None, None)
+ .await
+ .unwrap();
+
+ let expected_post_listing_no_person = expected_post_view(&data, pool).await;
+
+ // Should be 2 posts, with the bot post, and the blocked
+ assert_eq!(3, read_post_listing_multiple_no_person.len());
+
+ assert_eq!(
+ expected_post_listing_no_person,
+ read_post_listing_multiple_no_person[1]
+ );
+ assert_eq!(
+ expected_post_listing_no_person,
+ read_post_listing_single_no_person
+ );
+
+ cleanup(data, pool).await;
+ }
+
+ #[tokio::test]
+ #[serial]
+ async fn post_listing_block_community() {
+ let pool = &build_db_pool_for_tests().await;
+ let pool = &mut pool.into();
+ let data = init_data(pool).await;
+
+ let community_block = CommunityBlockForm {
+ person_id: data.local_user_view.person.id,
+ community_id: data.inserted_community.id,