CommonAPITest: Fix tests

This commit is contained in:
Lain Soykaf 2023-12-11 10:46:26 +04:00
parent 6e448ef239
commit f5a2337b37
1 changed files with 11 additions and 2 deletions

View File

@ -12,6 +12,7 @@ defmodule Pleroma.Web.CommonAPITest do
alias Pleroma.Notification alias Pleroma.Notification
alias Pleroma.Object alias Pleroma.Object
alias Pleroma.Repo alias Pleroma.Repo
alias Pleroma.UnstubbedConfigMock, as: ConfigMock
alias Pleroma.User alias Pleroma.User
alias Pleroma.Web.ActivityPub.ActivityPub alias Pleroma.Web.ActivityPub.ActivityPub
alias Pleroma.Web.ActivityPub.Transmogrifier alias Pleroma.Web.ActivityPub.Transmogrifier
@ -20,9 +21,10 @@ defmodule Pleroma.Web.CommonAPITest do
alias Pleroma.Web.CommonAPI alias Pleroma.Web.CommonAPI
alias Pleroma.Workers.PollWorker alias Pleroma.Workers.PollWorker
import Pleroma.Factory
import Mock
import Ecto.Query, only: [from: 2] import Ecto.Query, only: [from: 2]
import Mock
import Mox
import Pleroma.Factory
require Pleroma.Constants require Pleroma.Constants
@ -31,6 +33,13 @@ defmodule Pleroma.Web.CommonAPITest do
:ok :ok
end end
setup do
ConfigMock
|> stub_with(Pleroma.Test.StaticConfig)
:ok
end
setup do: clear_config([:instance, :safe_dm_mentions]) setup do: clear_config([:instance, :safe_dm_mentions])
setup do: clear_config([:instance, :limit]) setup do: clear_config([:instance, :limit])
setup do: clear_config([:instance, :max_pinned_statuses]) setup do: clear_config([:instance, :max_pinned_statuses])