lint
This commit is contained in:
parent
b9601ae11a
commit
ba8235ef50
1 changed files with 16 additions and 14 deletions
|
|
@ -102,12 +102,13 @@ defmodule Pleroma.Factory do
|
||||||
|
|
||||||
user = attrs[:user] || insert(:user)
|
user = attrs[:user] || insert(:user)
|
||||||
|
|
||||||
object_id = if attrs[:object_local] == false do
|
object_id =
|
||||||
# Must not match our Endpoint URL in the test env
|
if attrs[:object_local] == false do
|
||||||
"https://example.com/objects/#{Ecto.UUID.generate()}"
|
# Must not match our Endpoint URL in the test env
|
||||||
else
|
"https://example.com/objects/#{Ecto.UUID.generate()}"
|
||||||
Pleroma.Web.ActivityPub.Utils.generate_object_id()
|
else
|
||||||
end
|
Pleroma.Web.ActivityPub.Utils.generate_object_id()
|
||||||
|
end
|
||||||
|
|
||||||
data = %{
|
data = %{
|
||||||
"type" => "Note",
|
"type" => "Note",
|
||||||
|
|
@ -371,14 +372,15 @@ defmodule Pleroma.Factory do
|
||||||
object_local = if attrs[:object_local] == false, do: false, else: true
|
object_local = if attrs[:object_local] == false, do: false, else: true
|
||||||
note = attrs[:note] || insert(:note, user: user, object_local: object_local)
|
note = attrs[:note] || insert(:note, user: user, object_local: object_local)
|
||||||
|
|
||||||
activity_id = if attrs[:local] == false do
|
activity_id =
|
||||||
# Same domain as in note Object factory, it doesn't make sense
|
if attrs[:local] == false do
|
||||||
# to create mismatched Create Activities with an ID coming from
|
# Same domain as in note Object factory, it doesn't make sense
|
||||||
# a different domain than the Object
|
# to create mismatched Create Activities with an ID coming from
|
||||||
"https://example.com/activities/#{Ecto.UUID.generate()}"
|
# a different domain than the Object
|
||||||
else
|
"https://example.com/activities/#{Ecto.UUID.generate()}"
|
||||||
Pleroma.Web.ActivityPub.Utils.generate_activity_id()
|
else
|
||||||
end
|
Pleroma.Web.ActivityPub.Utils.generate_activity_id()
|
||||||
|
end
|
||||||
|
|
||||||
data_attrs = attrs[:data_attrs] || %{}
|
data_attrs = attrs[:data_attrs] || %{}
|
||||||
attrs = Map.drop(attrs, [:user, :note, :data_attrs, :object_local])
|
attrs = Map.drop(attrs, [:user, :note, :data_attrs, :object_local])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue