X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fsupport%2Ffactory.ex;h=314f26ec99d1de43b7d7f07311b50ab39753a867;hb=c098dec47344303bc00456bfbfc0d769abd8f199;hp=41e2b8004d515905d1d0833052c862d1a5af0bab;hpb=ce750dbab5de905af1e0ba6ba6a5a08b41600ac1;p=akkoma diff --git a/test/support/factory.ex b/test/support/factory.ex index 41e2b8004..314f26ec9 100644 --- a/test/support/factory.ex +++ b/test/support/factory.ex @@ -31,16 +31,27 @@ defmodule Pleroma.Factory do nickname: sequence(:nickname, &"nick#{&1}"), password_hash: Comeonin.Pbkdf2.hashpwsalt("test"), bio: sequence(:bio, &"Tester Number #{&1}"), - info: %{}, - last_digest_emailed_at: NaiveDateTime.utc_now() + last_digest_emailed_at: NaiveDateTime.utc_now(), + notification_settings: %Pleroma.User.NotificationSetting{} } %{ user | ap_id: User.ap_id(user), follower_address: User.ap_followers(user), - following_address: User.ap_following(user), - following: [User.ap_id(user)] + following_address: User.ap_following(user) + } + end + + def user_relationship_factory(attrs \\ %{}) do + source = attrs[:source] || insert(:user) + target = attrs[:target] || insert(:user) + relationship_type = attrs[:relationship_type] || :block + + %Pleroma.UserRelationship{ + source_id: source.id, + target_id: target.id, + relationship_type: relationship_type } end