[test] Sync: properly use last_sync timestamp

This commit is contained in:
daladim 2021-03-02 00:22:35 +01:00
parent 41502271ff
commit 57489ee04a

View file

@ -3,7 +3,7 @@ use std::path::PathBuf;
use chrono::{Utc, TimeZone}; use chrono::{Utc, TimeZone};
use url::Url; use url::Url;
use my_tasks::traits::CalDavSource; use my_tasks::traits::{CalDavSource, SyncSlave};
use my_tasks::traits::PartialCalendar; use my_tasks::traits::PartialCalendar;
use my_tasks::cache::Cache; use my_tasks::cache::Cache;
use my_tasks::Item; use my_tasks::Item;
@ -64,6 +64,7 @@ async fn populate_test_provider() -> Provider<Cache, CachedCalendar, Cache, Cach
let task_m = Item::Task(Task::new("task M".into(), Utc.ymd(2000, 1, 12).and_hms(0, 0, 0))); let task_m = Item::Task(Task::new("task M".into(), Utc.ymd(2000, 1, 12).and_hms(0, 0, 0)));
let last_sync = task_m.last_modified(); let last_sync = task_m.last_modified();
local.update_last_sync(Some(last_sync));
assert!(last_sync < Utc::now()); assert!(last_sync < Utc::now());
let task_b_id = task_b.id().clone(); let task_b_id = task_b.id().clone();