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(),
27 published: naive_now(),
32 theme: "darkly".into(),
33 default_sort_type: SortType::Hot as i16,
34 default_listing_type: ListingType::Subscribed as i16,
35 lang: "browser".into(),
37 send_notifications_to_email: false,
40 let person = user.as_person();
42 format!("https://{}/federation/u/thom", Settings::get().hostname),
43 person.object_props.id_string().unwrap()
49 let community = Community {
52 title: "Test Title".into(),
53 description: Some("Test community".into()),
57 published: naive_now(),
58 updated: Some(naive_now()),
63 let group = community.as_group();
65 format!("https://{}/federation/c/Test", Settings::get().hostname),
66 group.object_props.id_string().unwrap()
74 name: "A test post".into(),
79 published: naive_now(),
88 let page = post.as_page();
90 format!("https://{}/federation/post/62", Settings::get().hostname),
91 page.object_props.id_string().unwrap()
96 pub fn make_apub_endpoint<S: Display, T: Display>(point: S, value: T) -> String {
98 "https://{}/federation/{}/{}",
99 Settings::get().hostname,