add leniency to expiry
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful

This commit is contained in:
FloatingGhost 2022-08-02 15:32:23 +01:00
parent ca737a220f
commit 14a69a0914

View file

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