aboutsummaryrefslogtreecommitdiff
path: root/test/support
diff options
context:
space:
mode:
Diffstat (limited to 'test/support')
-rw-r--r--test/support/data_case.ex18
-rw-r--r--test/support/factory.ex9
2 files changed, 13 insertions, 14 deletions
diff --git a/test/support/data_case.ex b/test/support/data_case.ex
index 0ee2aa4a2..d4998a79c 100644
--- a/test/support/data_case.ex
+++ b/test/support/data_case.ex
@@ -48,19 +48,11 @@ defmodule Pleroma.DataCase do
end
def clear_cachex do
- Pleroma.Supervisor
- |> Supervisor.which_children()
- |> Enum.each(fn
- {name, _, _, [Cachex]} ->
- name
- |> to_string
- |> String.trim_leading("cachex_")
- |> Kernel.<>("_cache")
- |> String.to_existing_atom()
- |> Cachex.clear()
-
- _ ->
- nil
+ Pleroma.Application.StartUpDependencies.cachex_deps()
+ |> Enum.each(fn {name, _} ->
+ "#{name}_cache"
+ |> String.to_existing_atom()
+ |> Cachex.clear()
end)
end
diff --git a/test/support/factory.ex b/test/support/factory.ex
index 5c4e65c81..8f0e28b64 100644
--- a/test/support/factory.ex
+++ b/test/support/factory.ex
@@ -504,7 +504,7 @@ defmodule Pleroma.Factory do
value:
sequence(
:value,
- &%{another_key: "#{&1}somevalue", another: "#{&1}somevalue"}
+ &[another_key: "#{&1}somevalue", another: "#{&1}somevalue"]
)
}
|> merge_attributes(attrs)
@@ -536,4 +536,11 @@ defmodule Pleroma.Factory do
context: ["home"]
}
end
+
+ def config_version_factory do
+ %Pleroma.Config.Version{
+ backup: sequence(:value, &[pleroma: [instance: [name: "Instance name #{&1}"]]]),
+ current: false
+ }
+ end
end