From e82f9931a77aed34bbc098199dd4922f729211c3 Mon Sep 17 00:00:00 2001 From: lovasoa Date: Mon, 25 Nov 2024 23:00:08 +0100 Subject: [PATCH] fix test_transaction_error for postgres --- tests/failed_transaction.sql | 2 +- tests/index.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/failed_transaction.sql b/tests/failed_transaction.sql index 01deed95..b71c6718 100644 --- a/tests/failed_transaction.sql +++ b/tests/failed_transaction.sql @@ -1,5 +1,5 @@ BEGIN; -CREATE TEMPORARY TABLE t(f INTEGER NOT NULL); +CREATE TEMPORARY TABLE t(f VARCHAR(100) NOT NULL); INSERT INTO t(f) VALUES ($x); COMMIT; diff --git a/tests/index.rs b/tests/index.rs index f47eeb06..f49741ef 100644 --- a/tests/index.rs +++ b/tests/index.rs @@ -481,9 +481,9 @@ async fn test_transaction_error() -> actix_web::Result<()> { .to_srv_request(); let resp = main_handler(req).await?; let body = test::read_body(resp).await; - let body_str = String::from_utf8(body.to_vec()).unwrap(); + let body_str = String::from_utf8(body.to_vec()).unwrap().to_ascii_lowercase(); assert!( - body_str.contains("constraint failed"), + body_str.contains("error") && body_str.contains("null"), "{body_str}\nexpected to contain: constraint failed" ); // Now query again, with ?x=1447