Db, add core user functionality and tests; db mod
Adds all the basic user functions, and tests for them. This is also intializes the DB Module, which will have more things in it
This commit is contained in:
parent
eb21bf0d51
commit
ce95a54227
4 changed files with 185 additions and 0 deletions
|
|
@ -1,11 +1,24 @@
|
|||
#![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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue