11 use crate::db::community::Community;
12 use crate::db::post::Post;
13 use crate::db::user::User_;
14 use crate::db::{ListingType, SortType};
15 use crate::{naive_now, Settings};
22 fedi_name: "rrf".into(),
23 preferred_username: None,
24 password_encrypted: "here".into(),
28 published: naive_now(),
33 theme: "darkly".into(),
34 default_sort_type: SortType::Hot as i16,
35 default_listing_type: ListingType::Subscribed as i16,
36 lang: "browser".into(),
38 send_notifications_to_email: false,
41 let person = user.as_person();
43 format!("https://{}/federation/u/thom", Settings::get().hostname),
44 person.object_props.id_string().unwrap()
50 let community = Community {
53 title: "Test Title".into(),
54 description: Some("Test community".into()),
58 published: naive_now(),
59 updated: Some(naive_now()),
64 let group = community.as_group();
66 format!("https://{}/federation/c/Test", Settings::get().hostname),
67 group.object_props.id_string().unwrap()
75 name: "A test post".into(),
80 published: naive_now(),
89 let page = post.as_page();
91 format!("https://{}/federation/post/62", Settings::get().hostname),
92 page.object_props.id_string().unwrap()
97 pub fn make_apub_endpoint<S: Display, T: Display>(point: S, value: T) -> String {
99 "https://{}/federation/{}/{}",
100 Settings::get().hostname,