TwitterAPI: Add is_local to user view.
[akkoma] / test / support / factory.ex
index bb3bdb02c8adc4d6353c48e9a6aa2ead88c89486..7f378915ed93c76ba525de0c8149e8e494cd53a6 100644 (file)
@@ -7,13 +7,13 @@ defmodule Pleroma.Factory do
       email: sequence(:email, &"user#{&1}@example.com"),
       nickname: sequence(:nickname, &"nick#{&1}"),
       password_hash: Comeonin.Pbkdf2.hashpwsalt("test"),
-      bio: sequence(:bio, &"Tester Number #{&1}"),
+      bio: sequence(:bio, &"Tester Number #{&1}")
     }
-    %{ user | ap_id: Pleroma.User.ap_id(user) }
+    %{ user | ap_id: Pleroma.User.ap_id(user), follower_address: Pleroma.User.ap_followers(user), following: [Pleroma.User.ap_id(user)] }
   end
 
   def note_factory do
-    text = sequence(:text, &"This is note #{&1}")
+    text = sequence(:text, &"This is :moominmamma: note #{&1}")
 
     user = insert(:user)
     data = %{
@@ -26,7 +26,11 @@ defmodule Pleroma.Factory do
       "likes" => [],
       "like_count" => 0,
       "context" => "2hu",
-      "tag" => ["2hu"]
+      "summary" => "2hu",
+      "tag" => ["2hu"],
+      "emoji" => %{
+        "2hu" => "corndog.png"
+      }
     }
 
     %Pleroma.Object{
@@ -47,7 +51,8 @@ defmodule Pleroma.Factory do
     }
 
     %Pleroma.Activity{
-      data: data
+      data: data,
+      actor: data["actor"]
     }
   end