Mogrify args as custom tuples

This commit is contained in:
Alexander Strizhakov 2020-05-31 10:46:02 +03:00
commit 9a4fde9766
No known key found for this signature in database
GPG key ID: 022896A53AEF1381
13 changed files with 620 additions and 779 deletions

View file

@ -396,24 +396,17 @@ defmodule Pleroma.Factory do
}
end
def config_factory do
def config_factory(attrs \\ %{}) do
%Pleroma.ConfigDB{
key:
sequence(:key, fn key ->
# Atom dynamic registration hack in tests
"some_key_#{key}"
|> String.to_atom()
|> inspect()
end),
group: ":pleroma",
key: sequence(:key, &String.to_atom("some_key_#{&1}")),
group: :pleroma,
value:
sequence(
:value,
fn key ->
:erlang.term_to_binary(%{another_key: "#{key}somevalue", another: "#{key}somevalue"})
end
&%{another_key: "#{&1}somevalue", another: "#{&1}somevalue"}
)
}
|> merge_attributes(attrs)
end
def marker_factory do