use chrono::{TimeDelta, Utc}; use crate::{app::App, clock::RequestedAt, repo::pool}; pub mod channel; pub mod error; pub mod future; pub mod identity; pub mod login; pub mod message; pub async fn scratch_app() -> App { let pool = pool::prepare("sqlite::memory:") .await .expect("setting up in-memory sqlite database"); App::from(pool) .await .expect("creating an app from a fresh, in-memory database") } pub fn now() -> RequestedAt { Utc::now().into() } pub fn ancient() -> RequestedAt { let timestamp = Utc::now() - TimeDelta::days(365); timestamp.into() }