+
+ def follow_activity_factory do
+ follower = insert(:user)
+ followed = insert(:user)
+
+ data = %{
+ "id" => Pleroma.Web.ActivityPub.Utils.generate_activity_id(),
+ "actor" => follower.ap_id,
+ "type" => "Follow",
+ "object" => followed.ap_id,
+ "published_at" => DateTime.utc_now() |> DateTime.to_iso8601()
+ }
+
+ %Pleroma.Activity{
+ data: data,
+ actor: follower.ap_id
+ }
+ end
+
+ def websub_subscription_factory do
+ %Pleroma.Web.Websub.WebsubServerSubscription{
+ topic: "http://example.org",
+ callback: "http://example.org/callback",
+ secret: "here's a secret",
+ valid_until: NaiveDateTime.add(NaiveDateTime.utc_now(), 100),
+ state: "requested"
+ }
+ end
+
+ def websub_client_subscription_factory do
+ %Pleroma.Web.Websub.WebsubClientSubscription{
+ topic: "http://example.org",
+ secret: "here's a secret",
+ valid_until: nil,
+ state: "requested",
+ subscribers: []
+ }
+ end
+
+ def oauth_app_factory do
+ %Pleroma.Web.OAuth.App{
+ client_name: "Some client",
+ redirect_uris: "https://example.com/callback",
+ scopes: "read",
+ website: "https://example.com",
+ client_id: "aaabbb==",
+ client_secret: "aaa;/&bbb"
+ }
+ end
+
+ def instance_factory do
+ %Pleroma.Instances.Instance{
+ host: "domain.com",
+ unreachable_since: nil
+ }
+ end