diff options
author | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-12-03 01:28:54 +0000 |
---|---|---|
committer | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-12-03 01:28:54 +0000 |
commit | 05879a3b3ef656fd167e40e0a62c7a3c9f41facd (patch) | |
tree | a38ee456fec02bba2ef11398c38ff9f9af2e4123 /test | |
parent | c91ca482c2df85006d1967591730407230448316 (diff) | |
parent | 5d1548609843952bffa514af96e714756a7091ec (diff) | |
download | pleroma-05879a3b3ef656fd167e40e0a62c7a3c9f41facd.tar.gz |
Merge branch '2339-local-remote-mixup' into 'develop'
User: Don't allow local users in remote changesets
Closes #2339
See merge request pleroma/pleroma!3185
Diffstat (limited to 'test')
-rw-r--r-- | test/pleroma/user_test.exs | 7 | ||||
-rw-r--r-- | test/pleroma/web/activity_pub/side_effects_test.exs | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/test/pleroma/user_test.exs b/test/pleroma/user_test.exs index c678dadb3..e01a940cb 100644 --- a/test/pleroma/user_test.exs +++ b/test/pleroma/user_test.exs @@ -895,6 +895,13 @@ defmodule Pleroma.UserTest do refute cs.valid? end) end + + test "it is invalid given a local user" do + user = insert(:user) + cs = User.remote_user_changeset(user, %{name: "tom from myspace"}) + + refute cs.valid? + end end describe "followers and friends" do diff --git a/test/pleroma/web/activity_pub/side_effects_test.exs b/test/pleroma/web/activity_pub/side_effects_test.exs index 9efbaad04..297fc0b84 100644 --- a/test/pleroma/web/activity_pub/side_effects_test.exs +++ b/test/pleroma/web/activity_pub/side_effects_test.exs @@ -108,7 +108,7 @@ defmodule Pleroma.Web.ActivityPub.SideEffectsTest do describe "update users" do setup do - user = insert(:user) + user = insert(:user, local: false) {:ok, update_data, []} = Builder.update(user, %{"id" => user.ap_id, "name" => "new name!"}) {:ok, update, _meta} = ActivityPub.persist(update_data, local: true) |