diff options
author | sxsdv1 <sxsdv1@gmail.com> | 2019-01-05 10:38:38 +0100 |
---|---|---|
committer | sxsdv1 <sxsdv1@gmail.com> | 2019-01-05 11:16:05 +0100 |
commit | 2d7da5f4375164aa78e221ab054529a04d09e819 (patch) | |
tree | 38ddc652e9f986bb7bcbc1a2155ad3cd6d1dc284 /test/support | |
parent | ba17518a0aff404e265f4aebec1257912ad2750c (diff) | |
download | pleroma-2d7da5f4375164aa78e221ab054529a04d09e819.tar.gz |
Don't crash on AP request for tombstone
Because tombstone objects has no addressing the is_public?-predicate
would cause an error that propagated as a 500 error in the api
Diffstat (limited to 'test/support')
-rw-r--r-- | test/support/factory.ex | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/support/factory.ex b/test/support/factory.ex index e5c0c5bcc..57fa4a79d 100644 --- a/test/support/factory.ex +++ b/test/support/factory.ex @@ -57,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) |