List notifications working

This commit is contained in:
rzuasti
2026-02-19 10:57:04 -05:00
parent e0e05823d1
commit 5085bc0848
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -30,7 +30,7 @@ pub fn list() -> Result<Vec<Notification>, DbError> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use chrono::TimeZone; use chrono::{TimeZone, Utc};
use super::*; use super::*;
use crate::{model::notifications::NotificationType, tests_common}; use crate::{model::notifications::NotificationType, tests_common};
@@ -91,10 +91,10 @@ mod tests {
.next() .next()
.unwrap(); .unwrap();
// 2026-01-03 14:13:12 // 2026-01-03 14:13:12 - UTC
assert_eq!( assert_eq!(
notification1.created_on, 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." "Incorrect created_on date/time for notification 1."
); );
+1 -1
View File
@@ -45,7 +45,7 @@ pub async fn setup() {
if entry.path().extension().map_or(false, |ext| ext == "sql") { if entry.path().extension().map_or(false, |ext| ext == "sql") {
let sql = entry.as_file().unwrap().contents_utf8().unwrap(); 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); panic!("Error executing script: {}", err);
}); });
}; };