From 5085bc0848ff5f3631380b921d86a4e7d0ee9142 Mon Sep 17 00:00:00 2001 From: rzuasti Date: Thu, 19 Feb 2026 10:57:04 -0500 Subject: [PATCH] List notifications working --- backend/src/db/notifications.rs | 6 +++--- backend/src/tests_common.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/db/notifications.rs b/backend/src/db/notifications.rs index 20f40e5..bb09a27 100644 --- a/backend/src/db/notifications.rs +++ b/backend/src/db/notifications.rs @@ -30,7 +30,7 @@ pub fn list() -> Result, DbError> { #[cfg(test)] mod tests { - use chrono::TimeZone; + use chrono::{TimeZone, Utc}; use super::*; use crate::{model::notifications::NotificationType, tests_common}; @@ -91,10 +91,10 @@ mod tests { .next() .unwrap(); - // 2026-01-03 14:13:12 + // 2026-01-03 14:13:12 - UTC assert_eq!( notification1.created_on, - Local.with_ymd_and_hms(2026, 1, 3, 14, 13, 12).unwrap(), + Utc.with_ymd_and_hms(2026, 1, 3, 14, 13, 12).unwrap(), "Incorrect created_on date/time for notification 1." ); diff --git a/backend/src/tests_common.rs b/backend/src/tests_common.rs index 0d64054..aa19ce2 100644 --- a/backend/src/tests_common.rs +++ b/backend/src/tests_common.rs @@ -45,7 +45,7 @@ pub async fn setup() { if entry.path().extension().map_or(false, |ext| ext == "sql") { let sql = entry.as_file().unwrap().contents_utf8().unwrap(); - conn.execute(&sql, []).unwrap_or_else(|err| { + conn.execute_batch(&sql).unwrap_or_else(|err| { panic!("Error executing script: {}", err); }); };