diff options
author | Maxim Filippov <colixer@gmail.com> | 2019-12-12 02:16:23 +0300 |
---|---|---|
committer | Maxim Filippov <colixer@gmail.com> | 2019-12-12 02:16:23 +0300 |
commit | 3ecf131511afc1fc366be6402ca94cf0e6c30e11 (patch) | |
tree | 0e8a59c43ccc344bb7d57c32826675aa706b7e8e /test/support/factory.ex | |
parent | cc36a8ea906bd22884101632c6d62c9572e846e1 (diff) | |
parent | fd697cf2090b61db60a02694c3227850df176e2d (diff) | |
download | pleroma-3ecf131511afc1fc366be6402ca94cf0e6c30e11.tar.gz pleroma-3ecf131511afc1fc366be6402ca94cf0e6c30e11.zip |
Merge branch 'develop' into feature/report-notes
Diffstat (limited to 'test/support/factory.ex')
-rw-r--r-- | test/support/factory.ex | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/support/factory.ex b/test/support/factory.ex index bb8a64e72..314f26ec9 100644 --- a/test/support/factory.ex +++ b/test/support/factory.ex @@ -31,7 +31,8 @@ defmodule Pleroma.Factory do nickname: sequence(:nickname, &"nick#{&1}"), password_hash: Comeonin.Pbkdf2.hashpwsalt("test"), bio: sequence(:bio, &"Tester Number #{&1}"), - last_digest_emailed_at: NaiveDateTime.utc_now() + last_digest_emailed_at: NaiveDateTime.utc_now(), + notification_settings: %Pleroma.User.NotificationSetting{} } %{ @@ -42,6 +43,18 @@ defmodule Pleroma.Factory do } 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 + def note_factory(attrs \\ %{}) do text = sequence(:text, &"This is :moominmamma: note #{&1}") |