Koucha/koucha/src/test_utils.rs

25 lines
406 B
Rust
Raw Normal View History

#![cfg(test)]
use crate::{
Adapter,
AdapterBuilder,
};
use chrono::{
Utc,
TimeZone,
DateTime
};
pub const USERNAME: &str = "Alice";
pub const USERNAME2: &str = "Bob";
pub fn get_datetime() -> DateTime<Utc> {
Utc.with_ymd_and_hms(2020,1,1,0,0,0).unwrap()
}
pub async fn setup_adapter() -> Adapter {
AdapterBuilder::new()
.database_url("sqlite::memory:")
.create().await.unwrap()
}