Permit backdating the poll closed timestamp

This commit is contained in:
Mark Felder 2024-09-30 14:45:13 -04:00
parent 766edfe5b2
commit b2340b5b77

View file

@ -241,6 +241,7 @@ defmodule Pleroma.Factory do
def question_factory(attrs \\ %{}) do def question_factory(attrs \\ %{}) do
user = attrs[:user] || insert(:user) user = attrs[:user] || insert(:user)
closed = attrs[:closed] || DateTime.utc_now() |> DateTime.add(86_400) |> DateTime.to_iso8601()
data = %{ data = %{
"id" => Pleroma.Web.ActivityPub.Utils.generate_object_id(), "id" => Pleroma.Web.ActivityPub.Utils.generate_object_id(),
@ -251,7 +252,7 @@ defmodule Pleroma.Factory do
"to" => ["https://www.w3.org/ns/activitystreams#Public"], "to" => ["https://www.w3.org/ns/activitystreams#Public"],
"cc" => [user.follower_address], "cc" => [user.follower_address],
"context" => Pleroma.Web.ActivityPub.Utils.generate_context_id(), "context" => Pleroma.Web.ActivityPub.Utils.generate_context_id(),
"closed" => DateTime.utc_now() |> DateTime.add(86_400) |> DateTime.to_iso8601(), "closed" => closed,
"content" => "Which flavor of ice cream do you prefer?", "content" => "Which flavor of ice cream do you prefer?",
"oneOf" => [ "oneOf" => [
%{ %{