MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / new

Method new

tests/common/mod.rs:15–28  ·  view source on GitHub ↗
(test_name: &str)

Source from the content-addressed store, hash-verified

13
14impl TestContext {
15 pub async fn new(test_name: &str) -> Self {
16 dotenv::from_filename(".env.local").ok();
17 dotenv::from_filename(".env").ok();
18
19 let base_url =
20 std::env::var("DATABASE_URL").expect("Environment variable 'DATABASE_URL' not set");
21 let db: DatabaseConnection = setup::setup(&base_url, test_name).await;
22
23 Self {
24 base_url,
25 db_name: test_name.to_string(),
26 db,
27 }
28 }
29
30 pub async fn delete(&self) {
31 setup::tear_down(&self.base_url, &self.db_name).await;

Callers

nothing calls this directly

Calls 1

setupFunction · 0.50

Tested by

no test coverage detected