Merge branch 'bugfix/answer-outbox' into 'develop'
[akkoma] / test / pleroma / web / streamer_test.exs
index ad66ddc9d6dc75876bbc5905fae36f6d023a6d64..cef2b7629bf9ec8a7d8c369ef188861cb12ede37 100644 (file)
@@ -1,5 +1,5 @@
 # Pleroma: A lightweight social networking server
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Web.StreamerTest do
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Web.StreamerTest do
@@ -266,7 +266,7 @@ defmodule Pleroma.Web.StreamerTest do
       {:ok, create_activity} =
         CommonAPI.post_chat_message(other_user, user, "hey cirno", idempotency_key: "123")
 
       {:ok, create_activity} =
         CommonAPI.post_chat_message(other_user, user, "hey cirno", idempotency_key: "123")
 
-      object = Object.normalize(create_activity, false)
+      object = Object.normalize(create_activity, fetch: false)
       chat = Chat.get(user.id, other_user.ap_id)
       cm_ref = MessageReference.for_chat_and_object(chat, object)
       cm_ref = %{cm_ref | chat: chat, object: object}
       chat = Chat.get(user.id, other_user.ap_id)
       cm_ref = MessageReference.for_chat_and_object(chat, object)
       cm_ref = %{cm_ref | chat: chat, object: object}
@@ -284,7 +284,7 @@ defmodule Pleroma.Web.StreamerTest do
       other_user = insert(:user)
 
       {:ok, create_activity} = CommonAPI.post_chat_message(other_user, user, "hey cirno")
       other_user = insert(:user)
 
       {:ok, create_activity} = CommonAPI.post_chat_message(other_user, user, "hey cirno")
-      object = Object.normalize(create_activity, false)
+      object = Object.normalize(create_activity, fetch: false)
       chat = Chat.get(user.id, other_user.ap_id)
       cm_ref = MessageReference.for_chat_and_object(chat, object)
       cm_ref = %{cm_ref | chat: chat, object: object}
       chat = Chat.get(user.id, other_user.ap_id)
       cm_ref = MessageReference.for_chat_and_object(chat, object)
       cm_ref = %{cm_ref | chat: chat, object: object}
@@ -510,7 +510,7 @@ defmodule Pleroma.Web.StreamerTest do
 
   describe "thread_containment/2" do
     test "it filters to user if recipients invalid and thread containment is enabled" do
 
   describe "thread_containment/2" do
     test "it filters to user if recipients invalid and thread containment is enabled" do
-      Pleroma.Config.put([:instance, :skip_thread_containment], false)
+      clear_config([:instance, :skip_thread_containment], false)
       author = insert(:user)
       %{user: user, token: oauth_token} = oauth_access(["read"])
       User.follow(user, author, :follow_accept)
       author = insert(:user)
       %{user: user, token: oauth_token} = oauth_access(["read"])
       User.follow(user, author, :follow_accept)
@@ -531,7 +531,7 @@ defmodule Pleroma.Web.StreamerTest do
     end
 
     test "it sends message if recipients invalid and thread containment is disabled" do
     end
 
     test "it sends message if recipients invalid and thread containment is disabled" do
-      Pleroma.Config.put([:instance, :skip_thread_containment], true)
+      clear_config([:instance, :skip_thread_containment], true)
       author = insert(:user)
       %{user: user, token: oauth_token} = oauth_access(["read"])
       User.follow(user, author, :follow_accept)
       author = insert(:user)
       %{user: user, token: oauth_token} = oauth_access(["read"])
       User.follow(user, author, :follow_accept)
@@ -553,7 +553,7 @@ defmodule Pleroma.Web.StreamerTest do
     end
 
     test "it sends message if recipients invalid and thread containment is enabled but user's thread containment is disabled" do
     end
 
     test "it sends message if recipients invalid and thread containment is enabled but user's thread containment is disabled" do
-      Pleroma.Config.put([:instance, :skip_thread_containment], false)
+      clear_config([:instance, :skip_thread_containment], false)
       author = insert(:user)
       user = insert(:user, skip_thread_containment: true)
       %{token: oauth_token} = oauth_access(["read"], user: user)
       author = insert(:user)
       user = insert(:user, skip_thread_containment: true)
       %{token: oauth_token} = oauth_access(["read"], user: user)