fix backend tests

This commit is contained in:
2024-09-02 13:35:12 +03:00
parent 6b88927880
commit 2dc145e697
6 changed files with 27 additions and 23 deletions

View File

@ -82,7 +82,7 @@ impl Trip {
}
// don't notify people who have cancelled their trip
if notify.cancelled(db) {
if notify.cancelled() {
continue;
}
@ -406,7 +406,7 @@ mod test {
testdb,
};
use chrono::NaiveDate;
use chrono::Local;
use sqlx::SqlitePool;
use super::Trip;
@ -433,7 +433,8 @@ mod test {
fn test_get_day_cox_trip() {
let pool = testdb!();
let res = Trip::get_for_day(&pool, NaiveDate::from_ymd_opt(1970, 1, 2).unwrap()).await;
let tomorrow = Local::now().date_naive() + chrono::Duration::days(1);
let res = Trip::get_for_day(&pool, tomorrow).await;
assert_eq!(res.len(), 1);
}
@ -489,7 +490,6 @@ mod test {
max_people: 10,
notes: None,
trip_type: None,
always_show: false,
is_locked: false,
};
@ -518,7 +518,6 @@ mod test {
max_people: 10,
notes: None,
trip_type: Some(1),
always_show: false,
is_locked: false,
};
assert!(Trip::update_own(&pool, &update).await.is_ok());
@ -547,7 +546,6 @@ mod test {
max_people: 10,
notes: None,
trip_type: None,
always_show: false,
is_locked: false,
};
assert!(Trip::update_own(&pool, &update).await.is_err());