X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Fweb%2Fmedia_proxy%2Finvalidation_test.exs;h=c77b8c94aea4002fb9fd0deeb192892510222eb9;hb=d3660b24d37862bb58cf309c582cfe7432fd7bb6;hp=b7be36b470a0a8a6c9874dca05466eaa5296a7bc;hpb=95a9bdfc374a013be47e74b25bdba5d91f51948b;p=akkoma
diff --git a/test/pleroma/web/media_proxy/invalidation_test.exs b/test/pleroma/web/media_proxy/invalidation_test.exs
index b7be36b47..c77b8c94a 100644
--- a/test/pleroma/web/media_proxy/invalidation_test.exs
+++ b/test/pleroma/web/media_proxy/invalidation_test.exs
@@ -1,11 +1,10 @@
# 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.Web.MediaProxy.InvalidationTest do
use Pleroma.DataCase
- alias Pleroma.Config
alias Pleroma.Web.MediaProxy.Invalidation
import ExUnit.CaptureLog
@@ -16,11 +15,11 @@ defmodule Pleroma.Web.MediaProxy.InvalidationTest do
describe "Invalidation.Http" do
test "perform request to clear cache" do
- Config.put([:media_proxy, :enabled], false)
- Config.put([:media_proxy, :invalidation, :enabled], true)
- Config.put([:media_proxy, :invalidation, :provider], Invalidation.Http)
+ clear_config([:media_proxy, :enabled], false)
+ clear_config([:media_proxy, :invalidation, :enabled], true)
+ clear_config([:media_proxy, :invalidation, :provider], Invalidation.Http)
- Config.put([Invalidation.Http], method: :purge, headers: [{"x-refresh", 1}])
+ clear_config([Invalidation.Http], method: :purge, headers: [{"x-refresh", 1}])
image_url = "http://example.com/media/example.jpg"
Pleroma.Web.MediaProxy.put_in_banned_urls(image_url)
@@ -43,10 +42,10 @@ defmodule Pleroma.Web.MediaProxy.InvalidationTest do
describe "Invalidation.Script" do
test "run script to clear cache" do
- Config.put([:media_proxy, :enabled], false)
- Config.put([:media_proxy, :invalidation, :enabled], true)
- Config.put([:media_proxy, :invalidation, :provider], Invalidation.Script)
- Config.put([Invalidation.Script], script_path: "purge-nginx")
+ clear_config([:media_proxy, :enabled], false)
+ clear_config([:media_proxy, :invalidation, :enabled], true)
+ clear_config([:media_proxy, :invalidation, :provider], Invalidation.Script)
+ clear_config([Invalidation.Script], script_path: "purge-nginx")
image_url = "http://example.com/media/example.jpg"
Pleroma.Web.MediaProxy.put_in_banned_urls(image_url)