Changed test database to memory

This commit is contained in:
Joe Bellus 2022-02-12 02:58:09 -05:00
parent 2a1d0737a0
commit c9f04ef957
1 changed files with 1 additions and 2 deletions

View File

@ -97,9 +97,8 @@ pub mod test_prelude {
/// Sets up a testing state with an in-memory database and creates the scheme. /// Sets up a testing state with an in-memory database and creates the scheme.
pub async fn setup_state() -> Result<actix_web::web::Data<AppState>> { pub async fn setup_state() -> Result<actix_web::web::Data<AppState>> {
let pool = sqlx::SqlitePool::connect(":memory:").await?; let pool = sqlx::SqlitePool::connect("sqlite::memory:").await?;
sqlx::migrate!("./migrations").run(&pool).await?; sqlx::migrate!("./migrations").run(&pool).await?;
tracing::info!("Database migrated");
let db = sea_orm::SqlxSqliteConnector::from_sqlx_sqlite_pool(pool); let db = sea_orm::SqlxSqliteConnector::from_sqlx_sqlite_pool(pool);