mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
List notifications working
This commit is contained in:
@@ -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."
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user