mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-05-19 18:18:07 +00:00
Set uploader to Pleroma.Uploaders.Local for failing tests
There were tests who were failing with ``` The following arguments were given to IO.chardata_to_string/1: # 1 nil Attempted function clauses (showing 2 out of 2): def chardata_to_string(string) when is_binary(string) def chardata_to_string(list) when is_list(list) ``` I noticed for several of them the problem was that the uploader was set to S3, while the rest of the S3 settings were nil. The uploader itself didn't really matter much for the tests, but if it throws errors because it has settings that can't work, then the test fails. I made changed the uploader to local first.
This commit is contained in:
parent
3fb9171694
commit
a4097e0802
|
@ -23,6 +23,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
|
|||
import Tesla.Mock
|
||||
|
||||
setup do
|
||||
clear_config([Pleroma.Upload, :uploader], Pleroma.Uploaders.Local)
|
||||
clear_config([Pleroma.Uploaders.Local, :uploads], "uploads")
|
||||
mock(fn env -> apply(HttpRequestMock, :request, [env]) end)
|
||||
:ok
|
||||
end
|
||||
|
|
|
@ -27,6 +27,8 @@ defmodule Pleroma.Web.CommonAPITest do
|
|||
require Pleroma.Constants
|
||||
|
||||
setup_all do
|
||||
clear_config([Pleroma.Upload, :uploader], Pleroma.Uploaders.Local)
|
||||
clear_config([Pleroma.Uploaders.Local, :uploads], "uploads")
|
||||
Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end)
|
||||
:ok
|
||||
end
|
||||
|
|
|
@ -13,6 +13,8 @@ defmodule Pleroma.Web.MastodonAPI.MediaControllerTest do
|
|||
|
||||
describe "Upload media" do
|
||||
setup do: oauth_access(["write:media"])
|
||||
setup do: clear_config([Pleroma.Upload, :uploader], Pleroma.Uploaders.Local)
|
||||
setup do: clear_config([Pleroma.Uploaders.Local, :uploads], "uploads")
|
||||
|
||||
setup do
|
||||
image = %Plug.Upload{
|
||||
|
|
|
@ -25,6 +25,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
setup do: clear_config([:rich_media, :enabled])
|
||||
setup do: clear_config([:mrf, :policies])
|
||||
setup do: clear_config([:mrf_keyword, :reject])
|
||||
setup do: clear_config([Pleroma.Upload, :uploader], Pleroma.Uploaders.Local)
|
||||
setup do: clear_config([Pleroma.Uploaders.Local, :uploads], "uploads")
|
||||
|
||||
describe "posting statuses" do
|
||||
setup do: oauth_access(["write:statuses"])
|
||||
|
|
|
@ -106,6 +106,9 @@ defmodule Pleroma.Web.PleromaAPI.ChatControllerTest do
|
|||
end
|
||||
|
||||
test "it works with an attachment", %{conn: conn, user: user} do
|
||||
clear_config([Pleroma.Upload, :uploader], Pleroma.Uploaders.Local)
|
||||
clear_config([Pleroma.Uploaders.Local, :uploads], "uploads")
|
||||
|
||||
file = %Plug.Upload{
|
||||
content_type: "image/jpeg",
|
||||
path: Path.absname("test/fixtures/image.jpg"),
|
||||
|
|
Loading…
Reference in a new issue