From 14a69a091497b68f6d5739a81d474898623d8eb4 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Tue, 2 Aug 2022 15:32:23 +0100 Subject: [PATCH] add leniency to expiry --- .../web/mastodon_api/controllers/filter_controller_test.exs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs index 90aa9398f..66f7ed579 100644 --- a/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs @@ -67,9 +67,11 @@ test "a filter with expires_in", %{conn: conn, user: user} do expires_at = NaiveDateTime.utc_now() |> NaiveDateTime.add(in_seconds) - |> Pleroma.Web.CommonAPI.Utils.to_masto_date() - assert response["expires_at"] == expires_at + assert NaiveDateTime.diff( + NaiveDateTime.from_iso8601!(response["expires_at"]), + expires_at + ) < 5 filter = Filter.get(response["id"], user)