From ddba7d6fc5924191ee10dcd23ae8c6798a5469cf Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 20 Apr 2023 09:39:19 +0200 Subject: [PATCH] test: Fix Mobilizon.Service.Notifications.SchedulerTest tests Signed-off-by: Thomas Citharel --- test/service/notifications/scheduler_test.exs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/service/notifications/scheduler_test.exs b/test/service/notifications/scheduler_test.exs index 3bdc5c9e4..318213a43 100644 --- a/test/service/notifications/scheduler_test.exs +++ b/test/service/notifications/scheduler_test.exs @@ -71,7 +71,9 @@ defmodule Mobilizon.Service.Notifications.SchedulerTest do assert_enqueued( worker: Notification, args: %{user_id: user_id, op: :on_day_notification}, - scheduled_at: %{DateTime.shift_zone!(begins_on, settings.timezone) | hour: 8} + scheduled_at: + %{DateTime.shift_zone!(begins_on, settings.timezone) | hour: 8} + |> DateTime.shift_zone!("Etc/UTC") ) end @@ -131,7 +133,9 @@ defmodule Mobilizon.Service.Notifications.SchedulerTest do assert_enqueued( worker: Notification, args: %{user_id: user_id, op: :on_day_notification}, - scheduled_at: %{DateTime.shift_zone!(begins_on, settings.timezone) | hour: 8} + scheduled_at: + %{DateTime.shift_zone!(begins_on, settings.timezone) | hour: 8} + |> DateTime.shift_zone!("Etc/UTC") ) %DateTime{} = tomorrow = DateTime.utc_now() |> DateTime.add(3600 * 24) @@ -177,7 +181,7 @@ defmodule Mobilizon.Service.Notifications.SchedulerTest do assert_enqueued( worker: Notification, args: %{user_id: user_id, op: :weekly_notification}, - scheduled_at: scheduled_at + scheduled_at: DateTime.shift_zone!(scheduled_at, "Etc/UTC") ) end @@ -360,7 +364,7 @@ defmodule Mobilizon.Service.Notifications.SchedulerTest do assert_enqueued( worker: Notification, args: %{user_id: user_id, event_id: event.id, op: :pending_participation_notification}, - scheduled_at: scheduled_at + scheduled_at: DateTime.shift_zone!(scheduled_at, "Etc/UTC") ) end end