blob: a42dba5a6e9067da6f4099e5d0389c6d4a883a73 (
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
26
27
|
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)
.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()
}
|