Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TwoDCube committed Dec 2, 2024
1 parent 9890c01 commit 7d0b769
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/connection_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,23 @@ pub async fn connection_ping_closed_postgres() {

ctx.delete().await;
}

#[sea_orm_macros::test]
#[cfg(feature = "sqlx-postgres")]
pub async fn connection_with_search_path_postgres() {
let ctx = TestContext::new("connection_with_search_path").await;

let base_url = std::env::var("DATABASE_URL").unwrap();
let mut opt = sea_orm::ConnectOptions::new(format!("{base_url}/connection_with_search_path"));
opt
// The connection pool has a single connection only
.max_connections(1)
// A controlled connection acquire timeout
.acquire_timeout(std::time::Duration::from_secs(2))
.set_schema_search_path("schema-with-special-characters");

let db = sea_orm::Database::connect(opt).await;
assert!(db.is_ok());

ctx.delete().await;
}

0 comments on commit 7d0b769

Please sign in to comment.