Test removed HTTP adapter

This commit is contained in:
FloatingGhost 2022-12-11 23:50:31 +00:00
parent 503827a3d9
commit 9c71782861
4 changed files with 16 additions and 2 deletions

View file

@ -1056,7 +1056,7 @@ Most of the settings will be applied in `runtime`, this means that you don't nee
Example of setting without keyword in value: Example of setting without keyword in value:
```elixir ```elixir
config :tesla, :adapter, Tesla.Adapter.Hackney config :tesla, :adapter, {Tesla.Adapter.Finch, name: MyFinch}
``` ```
List of settings which support only full update by key: List of settings which support only full update by key:

View file

@ -213,6 +213,7 @@ defmodule Pleroma.Config.DeprecationWarnings do
def check_http_adapter do def check_http_adapter do
http_adapter = Application.get_env(:tesla, :adapter) http_adapter = Application.get_env(:tesla, :adapter)
case http_adapter do case http_adapter do
{Tesla.Adapter.Finch, _} -> {Tesla.Adapter.Finch, _} ->
:ok :ok

View file

@ -0,0 +1,11 @@
defmodule Pleroma.Repo.Migrations.RemoveUnusedIndices do
use Ecto.Migration
def change do
drop_if_exists(
index(:activities, ["(data->>'actor')", "inserted_at desc"], name: :activities_actor_index)
)
drop_if_exists(index(:objects, ["(data->'tag')"], using: :gin, name: :objects_tags))
end
end

View file

@ -281,10 +281,12 @@ defmodule Pleroma.Config.DeprecationWarningsTest do
end end
test "check_http_adapter/0" do test "check_http_adapter/0" do
clear_config([:tesla, :adapter], Gun) Application.put_env(:tesla, :adapter, Gun)
assert capture_log(fn -> assert capture_log(fn ->
DeprecationWarnings.check_http_adapter() DeprecationWarnings.check_http_adapter()
end) =~ "Your config is using a custom tesla adapter" end) =~ "Your config is using a custom tesla adapter"
Application.put_env(:tesla, :adapter, Tesla.Mock)
end end
end end