fixes for tests
This commit is contained in:
parent
ed189568f3
commit
b66e6eb521
@ -33,6 +33,6 @@ as soon as the post is received by your instance.
|
|||||||
Add to your `prod.secret.exs`:
|
Add to your `prod.secret.exs`:
|
||||||
|
|
||||||
```
|
```
|
||||||
config :pleroma, :instance,
|
config :pleroma, :mrf,
|
||||||
rewrite_policy: [Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy]
|
policies: [Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy]
|
||||||
```
|
```
|
||||||
|
@ -54,13 +54,13 @@ defmodule Pleroma.ConfigDB do
|
|||||||
|
|
||||||
defp create(params) do
|
defp create(params) do
|
||||||
%ConfigDB{}
|
%ConfigDB{}
|
||||||
|> changeset(params, transform?)
|
|> changeset(params)
|
||||||
|> Repo.insert()
|
|> Repo.insert()
|
||||||
end
|
end
|
||||||
|
|
||||||
defp update(%ConfigDB{} = config, %{value: value}) do
|
defp update(%ConfigDB{} = config, %{value: value}) do
|
||||||
config
|
config
|
||||||
|> changeset(%{value: value}, transform?)
|
|> changeset(%{value: value})
|
||||||
|> Repo.update()
|
|> Repo.update()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -2055,11 +2055,11 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe "global activity expiration" do
|
describe "global activity expiration" do
|
||||||
setup do: clear_config([:instance, :rewrite_policy])
|
setup do: clear_config([:mrf, :policies])
|
||||||
|
|
||||||
test "creates an activity expiration for local Create activities" do
|
test "creates an activity expiration for local Create activities" do
|
||||||
Pleroma.Config.put(
|
Pleroma.Config.put(
|
||||||
[:instance, :rewrite_policy],
|
[:mrf, :policies],
|
||||||
Pleroma.Web.ActivityPub.MRF.ActivityExpirationPolicy
|
Pleroma.Web.ActivityPub.MRF.ActivityExpirationPolicy
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ defmodule Pleroma.Workers.Cron.PurgeExpiredActivitiesWorkerTest do
|
|||||||
|
|
||||||
setup do
|
setup do
|
||||||
clear_config([ActivityExpiration, :enabled])
|
clear_config([ActivityExpiration, :enabled])
|
||||||
clear_config([:instance, :rewrite_policy])
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "deletes an expiration activity" do
|
test "deletes an expiration activity" do
|
||||||
@ -42,10 +41,7 @@ defmodule Pleroma.Workers.Cron.PurgeExpiredActivitiesWorkerTest do
|
|||||||
test "works with ActivityExpirationPolicy" do
|
test "works with ActivityExpirationPolicy" do
|
||||||
Pleroma.Config.put([ActivityExpiration, :enabled], true)
|
Pleroma.Config.put([ActivityExpiration, :enabled], true)
|
||||||
|
|
||||||
Pleroma.Config.put(
|
clear_config([:mrf, :policies], Pleroma.Web.ActivityPub.MRF.ActivityExpirationPolicy)
|
||||||
[:instance, :rewrite_policy],
|
|
||||||
Pleroma.Web.ActivityPub.MRF.ActivityExpirationPolicy
|
|
||||||
)
|
|
||||||
|
|
||||||
user = insert(:user)
|
user = insert(:user)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user