10 use crate::db::community::Community;
11 use crate::db::post::Post;
12 use crate::db::user::User_;
13 use crate::db::{ListingType, SortType};
14 use crate::{naive_now, Settings};
21 fedi_name: "rrf".into(),
22 preferred_username: None,
23 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(),
87 embed_description: None,
92 let page = post.as_page();
94 format!("https://{}/federation/post/62", Settings::get().hostname),
95 page.object_props.id_string().unwrap()
100 pub fn make_apub_endpoint<S: Display, T: Display>(point: S, value: T) -> String {
102 "https://{}/federation/{}/{}",
103 Settings::get().hostname,