Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Mar 7, 2024
1 parent 11755b5 commit 64b813a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tests/sql_err_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,11 @@ pub async fn test_error(db: &DatabaseConnection) {
// if compiling without sqlx, this assignment will complain,
// but the whole test is useless in that case anyway.
#[allow(unused_variables)]
let error: DbErr = cake::ActiveModel {
id: NotSet,
..cake.into_active_model()
}
.insert(db)
.await
.expect_err("inserting should fail due to duplicate primary key");
let error: DbErr = cake
.into_active_model()
.insert(db)
.await
.expect_err("inserting should fail due to duplicate primary key");

assert!(matches!(
error.sql_err(),
Expand Down

0 comments on commit 64b813a

Please sign in to comment.