Skip to content

Commit f00ed8d

Browse files
committed
tests/schema_details: Simplify test setup
We don't need a full app for this test, a test database is sufficient.
1 parent d90ce45 commit f00ed8d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/tests/schema_details.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
use crates_io_test_db::TestDatabase;
12
use diesel::prelude::*;
23
use diesel::sql_types::Text;
34

4-
use crate::tests::TestApp;
5-
65
#[test]
76
fn all_columns_called_crate_id_have_a_cascading_foreign_key() {
87
for row in get_fk_constraint_definitions("crate_id") {
@@ -70,8 +69,8 @@ struct TableNameAndConstraint {
7069
fn get_fk_constraint_definitions(column_name: &str) -> Vec<TableNameAndConstraint> {
7170
use diesel::sql_query;
7271

73-
let (app, _) = TestApp::init().empty();
74-
let mut conn = app.db_conn();
72+
let test_db = TestDatabase::new();
73+
let mut conn = test_db.connect();
7574

7675
sql_query(include_str!("load_foreign_key_constraints.sql"))
7776
.bind::<Text, _>(column_name)

0 commit comments

Comments
 (0)