Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into feature/pinned...
[akkoma] / test / support / factory.ex
index 2889d8977fb803e1e9448b92dd95dc9ba11fdc09..57fa4a79d68a65e29c64277ca992b190dd37bd8d 100644 (file)
@@ -1,3 +1,7 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
 defmodule Pleroma.Factory do
   use ExMachina.Ecto, repo: Pleroma.Repo
 
@@ -53,6 +57,19 @@ defmodule Pleroma.Factory do
     %Pleroma.Object{data: Map.merge(data, %{"to" => [user2.ap_id]})}
   end
 
+  def tombstone_factory do
+    data = %{
+      "type" => "Tombstone",
+      "id" => Pleroma.Web.ActivityPub.Utils.generate_object_id(),
+      "formerType" => "Note",
+      "deleted" => DateTime.utc_now() |> DateTime.to_iso8601()
+    }
+
+    %Pleroma.Object{
+      data: data
+    }
+  end
+
   def direct_note_activity_factory do
     dm = insert(:direct_note)