blob: 450fbecf29932b607d2a468bc7b9e2580663581f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
use chrono::{TimeDelta, Utc};
use crate::{app::App, clock::RequestedAt, repo::pool};
pub mod channel;
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)
}
pub fn now() -> RequestedAt {
Utc::now().into()
}
pub fn ancient() -> RequestedAt {
let timestamp = Utc::now() - TimeDelta::days(365);
timestamp.into()
}
|