X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Fobject_test.exs;h=db7678d5d183ce9ab41079792924fccefc6513b9;hb=0a589c887bd4215e7d443a34c194fd0a3bde8f72;hp=fe7f37e7c320ad9d36d6feff6098ab94592e363e;hpb=80167e62dd7afaf761443d268d7c2306608ffea4;p=akkoma
diff --git a/test/pleroma/object_test.exs b/test/pleroma/object_test.exs
index fe7f37e7c..db7678d5d 100644
--- a/test/pleroma/object_test.exs
+++ b/test/pleroma/object_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.ObjectTest do
@@ -78,8 +78,8 @@ defmodule Pleroma.ObjectTest do
setup do: clear_config([:instance, :cleanup_attachments])
test "Disabled via config" do
- Pleroma.Config.put([Pleroma.Upload, :uploader], Pleroma.Uploaders.Local)
- Pleroma.Config.put([:instance, :cleanup_attachments], false)
+ clear_config([Pleroma.Upload, :uploader], Pleroma.Uploaders.Local)
+ clear_config([:instance, :cleanup_attachments], false)
file = %Plug.Upload{
content_type: "image/jpeg",
@@ -112,8 +112,8 @@ defmodule Pleroma.ObjectTest do
end
test "in subdirectories" do
- Pleroma.Config.put([Pleroma.Upload, :uploader], Pleroma.Uploaders.Local)
- Pleroma.Config.put([:instance, :cleanup_attachments], true)
+ clear_config([Pleroma.Upload, :uploader], Pleroma.Uploaders.Local)
+ clear_config([:instance, :cleanup_attachments], true)
file = %Plug.Upload{
content_type: "image/jpeg",
@@ -146,9 +146,9 @@ defmodule Pleroma.ObjectTest do
end
test "with dedupe enabled" do
- Pleroma.Config.put([Pleroma.Upload, :uploader], Pleroma.Uploaders.Local)
- Pleroma.Config.put([Pleroma.Upload, :filters], [Pleroma.Upload.Filter.Dedupe])
- Pleroma.Config.put([:instance, :cleanup_attachments], true)
+ clear_config([Pleroma.Upload, :uploader], Pleroma.Uploaders.Local)
+ clear_config([Pleroma.Upload, :filters], [Pleroma.Upload.Filter.Dedupe])
+ clear_config([:instance, :cleanup_attachments], true)
uploads_dir = Pleroma.Config.get!([Pleroma.Uploaders.Local, :uploads])
@@ -184,8 +184,8 @@ defmodule Pleroma.ObjectTest do
end
test "with objects that have legacy data.url attribute" do
- Pleroma.Config.put([Pleroma.Upload, :uploader], Pleroma.Uploaders.Local)
- Pleroma.Config.put([:instance, :cleanup_attachments], true)
+ clear_config([Pleroma.Upload, :uploader], Pleroma.Uploaders.Local)
+ clear_config([:instance, :cleanup_attachments], true)
file = %Plug.Upload{
content_type: "image/jpeg",
@@ -220,9 +220,9 @@ defmodule Pleroma.ObjectTest do
end
test "With custom base_url" do
- Pleroma.Config.put([Pleroma.Upload, :uploader], Pleroma.Uploaders.Local)
- Pleroma.Config.put([Pleroma.Upload, :base_url], "https://sub.domain.tld/dir/")
- Pleroma.Config.put([:instance, :cleanup_attachments], true)
+ clear_config([Pleroma.Upload, :uploader], Pleroma.Uploaders.Local)
+ clear_config([Pleroma.Upload, :base_url], "https://sub.domain.tld/dir/")
+ clear_config([:instance, :cleanup_attachments], true)
file = %Plug.Upload{
content_type: "image/jpeg",