test: Fix Mobilizon.Service.Notifications.SchedulerTest tests

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2023-04-20 09:39:19 +02:00
parent 52c4337c4f
commit ddba7d6fc5

View File

@@ -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