X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=inline;f=test%2Fpleroma%2Fweb%2Factivity_pub%2Ftransmogrifier%2Fdelete_handling_test.exs;h=b7160bf589acb9f9f79afc2228e5aa53f22fe9cb;hb=9ee27fb5ecfec639614640c9ce92c00e701b3d8c;hp=c9a53918c38bd1747cdc4122cdf3ee025b35f7cf;hpb=409f694e4f90d34285b43c7e7afc594bc386d893;p=akkoma
diff --git a/test/pleroma/web/activity_pub/transmogrifier/delete_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/delete_handling_test.exs
index c9a53918c..b7160bf58 100644
--- a/test/pleroma/web/activity_pub/transmogrifier/delete_handling_test.exs
+++ b/test/pleroma/web/activity_pub/transmogrifier/delete_handling_test.exs
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.Transmogrifier.DeleteHandlingTest do
@@ -25,7 +25,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.DeleteHandlingTest do
data =
File.read!("test/fixtures/mastodon-delete.json")
- |> Poison.decode!()
+ |> Jason.decode!()
|> Map.put("actor", deleting_user.ap_id)
|> put_in(["object", "id"], activity.data["object"])
@@ -40,7 +40,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.DeleteHandlingTest do
assert actor == deleting_user.ap_id
# Objects are replaced by a tombstone object.
- object = Object.normalize(activity.data["object"])
+ object = Object.normalize(activity.data["object"], fetch: false)
assert object.data["type"] == "Tombstone"
end
@@ -48,16 +48,17 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.DeleteHandlingTest do
activity = insert(:note_activity)
{:ok, object} =
- Object.normalize(activity.data["object"])
+ Object.normalize(activity.data["object"], fetch: false)
|> Repo.delete()
+ # TODO: mock cachex
Cachex.del(:object_cache, "object:#{object.data["id"]}")
deleting_user = insert(:user)
data =
File.read!("test/fixtures/mastodon-delete.json")
- |> Poison.decode!()
+ |> Jason.decode!()
|> Map.put("actor", deleting_user.ap_id)
|> put_in(["object", "id"], activity.data["object"])
@@ -78,7 +79,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.DeleteHandlingTest do
data =
File.read!("test/fixtures/mastodon-delete.json")
- |> Poison.decode!()
+ |> Jason.decode!()
|> Map.put("actor", ap_id)
|> put_in(["object", "id"], activity.data["object"])
@@ -91,12 +92,12 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.DeleteHandlingTest do
data =
File.read!("test/fixtures/mastodon-delete-user.json")
- |> Poison.decode!()
+ |> Jason.decode!()
{:ok, _} = Transmogrifier.handle_incoming(data)
ObanHelpers.perform_all()
- assert User.get_cached_by_ap_id(ap_id).deactivated
+ refute User.get_cached_by_ap_id(ap_id).is_active
end
test "it fails for incoming user deletes with spoofed origin" do
@@ -104,7 +105,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.DeleteHandlingTest do
data =
File.read!("test/fixtures/mastodon-delete-user.json")
- |> Poison.decode!()
+ |> Jason.decode!()
|> Map.put("actor", ap_id)
assert match?({:error, _}, Transmogrifier.handle_incoming(data))