Merge branch 'feature/database-compaction' into 'develop'
[akkoma] / test / web / twitter_api / twitter_api_test.exs
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
6 use Pleroma.DataCase
7 alias Pleroma.Activity
8 alias Pleroma.Object
9 alias Pleroma.Repo
10 alias Pleroma.User
11 alias Pleroma.UserInviteToken
12 alias Pleroma.Web.ActivityPub.ActivityPub
13 alias Pleroma.Web.TwitterAPI.ActivityView
14 alias Pleroma.Web.TwitterAPI.TwitterAPI
15 alias Pleroma.Web.TwitterAPI.UserView
16
17 import Pleroma.Factory
18
19 setup_all do
20 Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end)
21 :ok
22 end
23
24 test "create a status" do
25 user = insert(:user)
26 mentioned_user = insert(:user, %{nickname: "shp", ap_id: "shp"})
27
28 object_data = %{
29 "type" => "Image",
30 "url" => [
31 %{
32 "type" => "Link",
33 "mediaType" => "image/jpg",
34 "href" => "http://example.org/image.jpg"
35 }
36 ],
37 "uuid" => 1
38 }
39
40 object = Repo.insert!(%Object{data: object_data})
41
42 input = %{
43 "status" =>
44 "Hello again, @shp.<script></script>\nThis is on another :moominmamma: line. #2hu #epic #phantasmagoric",
45 "media_ids" => [object.id]
46 }
47
48 {:ok, activity = %Activity{}} = TwitterAPI.create_status(user, input)
49 object = Object.normalize(activity.data["object"])
50
51 expected_text =
52 "Hello again, <span class='h-card'><a data-user='#{mentioned_user.id}' class='u-url mention' href='shp'>@<span>shp</span></a></span>.&lt;script&gt;&lt;/script&gt;<br>This is on another :moominmamma: line. <a class='hashtag' data-tag='2hu' href='http://localhost:4001/tag/2hu' rel='tag'>#2hu</a> <a class='hashtag' data-tag='epic' href='http://localhost:4001/tag/epic' rel='tag'>#epic</a> <a class='hashtag' data-tag='phantasmagoric' href='http://localhost:4001/tag/phantasmagoric' rel='tag'>#phantasmagoric</a><br><a href=\"http://example.org/image.jpg\" class='attachment'>image.jpg</a>"
53
54 assert get_in(object.data, ["content"]) == expected_text
55 assert get_in(object.data, ["type"]) == "Note"
56 assert get_in(object.data, ["actor"]) == user.ap_id
57 assert get_in(activity.data, ["actor"]) == user.ap_id
58 assert Enum.member?(get_in(activity.data, ["cc"]), User.ap_followers(user))
59
60 assert Enum.member?(
61 get_in(activity.data, ["to"]),
62 "https://www.w3.org/ns/activitystreams#Public"
63 )
64
65 assert Enum.member?(get_in(activity.data, ["to"]), "shp")
66 assert activity.local == true
67
68 assert %{"moominmamma" => "http://localhost:4001/finmoji/128px/moominmamma-128.png"} =
69 object.data["emoji"]
70
71 # hashtags
72 assert object.data["tag"] == ["2hu", "epic", "phantasmagoric"]
73
74 # Add a context
75 assert is_binary(get_in(activity.data, ["context"]))
76 assert is_binary(get_in(object.data, ["context"]))
77
78 assert is_list(object.data["attachment"])
79
80 assert activity.data["object"] == object.data["id"]
81
82 user = User.get_by_ap_id(user.ap_id)
83
84 assert user.info.note_count == 1
85 end
86
87 test "create a status that is a reply" do
88 user = insert(:user)
89
90 input = %{
91 "status" => "Hello again."
92 }
93
94 {:ok, activity = %Activity{}} = TwitterAPI.create_status(user, input)
95 object = Object.normalize(activity.data["object"])
96
97 input = %{
98 "status" => "Here's your (you).",
99 "in_reply_to_status_id" => activity.id
100 }
101
102 {:ok, reply = %Activity{}} = TwitterAPI.create_status(user, input)
103 reply_object = Object.normalize(reply.data["object"])
104
105 assert get_in(reply.data, ["context"]) == get_in(activity.data, ["context"])
106
107 assert get_in(reply_object.data, ["context"]) == get_in(object.data, ["context"])
108
109 assert get_in(reply_object.data, ["inReplyTo"]) == get_in(activity.data, ["object"])
110 assert Activity.get_in_reply_to_activity(reply).id == activity.id
111 end
112
113 test "Follow another user using user_id" do
114 user = insert(:user)
115 followed = insert(:user)
116
117 {:ok, user, followed, _activity} = TwitterAPI.follow(user, %{"user_id" => followed.id})
118 assert User.ap_followers(followed) in user.following
119
120 {:error, msg} = TwitterAPI.follow(user, %{"user_id" => followed.id})
121 assert msg == "Could not follow user: #{followed.nickname} is already on your list."
122 end
123
124 test "Follow another user using screen_name" do
125 user = insert(:user)
126 followed = insert(:user)
127
128 {:ok, user, followed, _activity} =
129 TwitterAPI.follow(user, %{"screen_name" => followed.nickname})
130
131 assert User.ap_followers(followed) in user.following
132
133 followed = User.get_by_ap_id(followed.ap_id)
134 assert followed.info.follower_count == 1
135
136 {:error, msg} = TwitterAPI.follow(user, %{"screen_name" => followed.nickname})
137 assert msg == "Could not follow user: #{followed.nickname} is already on your list."
138 end
139
140 test "Unfollow another user using user_id" do
141 unfollowed = insert(:user)
142 user = insert(:user, %{following: [User.ap_followers(unfollowed)]})
143 ActivityPub.follow(user, unfollowed)
144
145 {:ok, user, unfollowed} = TwitterAPI.unfollow(user, %{"user_id" => unfollowed.id})
146 assert user.following == []
147
148 {:error, msg} = TwitterAPI.unfollow(user, %{"user_id" => unfollowed.id})
149 assert msg == "Not subscribed!"
150 end
151
152 test "Unfollow another user using screen_name" do
153 unfollowed = insert(:user)
154 user = insert(:user, %{following: [User.ap_followers(unfollowed)]})
155
156 ActivityPub.follow(user, unfollowed)
157
158 {:ok, user, unfollowed} = TwitterAPI.unfollow(user, %{"screen_name" => unfollowed.nickname})
159 assert user.following == []
160
161 {:error, msg} = TwitterAPI.unfollow(user, %{"screen_name" => unfollowed.nickname})
162 assert msg == "Not subscribed!"
163 end
164
165 test "Block another user using user_id" do
166 user = insert(:user)
167 blocked = insert(:user)
168
169 {:ok, user, blocked} = TwitterAPI.block(user, %{"user_id" => blocked.id})
170 assert User.blocks?(user, blocked)
171 end
172
173 test "Block another user using screen_name" do
174 user = insert(:user)
175 blocked = insert(:user)
176
177 {:ok, user, blocked} = TwitterAPI.block(user, %{"screen_name" => blocked.nickname})
178 assert User.blocks?(user, blocked)
179 end
180
181 test "Unblock another user using user_id" do
182 unblocked = insert(:user)
183 user = insert(:user)
184 {:ok, user, _unblocked} = TwitterAPI.block(user, %{"user_id" => unblocked.id})
185
186 {:ok, user, _unblocked} = TwitterAPI.unblock(user, %{"user_id" => unblocked.id})
187 assert user.info.blocks == []
188 end
189
190 test "Unblock another user using screen_name" do
191 unblocked = insert(:user)
192 user = insert(:user)
193 {:ok, user, _unblocked} = TwitterAPI.block(user, %{"screen_name" => unblocked.nickname})
194
195 {:ok, user, _unblocked} = TwitterAPI.unblock(user, %{"screen_name" => unblocked.nickname})
196 assert user.info.blocks == []
197 end
198
199 test "upload a file" do
200 user = insert(:user)
201
202 file = %Plug.Upload{
203 content_type: "image/jpg",
204 path: Path.absname("test/fixtures/image.jpg"),
205 filename: "an_image.jpg"
206 }
207
208 response = TwitterAPI.upload(file, user)
209
210 assert is_binary(response)
211 end
212
213 test "it favorites a status, returns the updated activity" do
214 user = insert(:user)
215 other_user = insert(:user)
216 note_activity = insert(:note_activity)
217
218 {:ok, status} = TwitterAPI.fav(user, note_activity.id)
219 updated_activity = Activity.get_by_ap_id(note_activity.data["id"])
220 assert ActivityView.render("activity.json", %{activity: updated_activity})["fave_num"] == 1
221
222 object = Object.normalize(note_activity.data["object"])
223
224 assert object.data["like_count"] == 1
225
226 assert status == updated_activity
227
228 {:ok, _status} = TwitterAPI.fav(other_user, note_activity.id)
229
230 object = Object.normalize(note_activity.data["object"])
231
232 assert object.data["like_count"] == 2
233
234 updated_activity = Activity.get_by_ap_id(note_activity.data["id"])
235 assert ActivityView.render("activity.json", %{activity: updated_activity})["fave_num"] == 2
236 end
237
238 test "it unfavorites a status, returns the updated activity" do
239 user = insert(:user)
240 note_activity = insert(:note_activity)
241 object = Object.get_by_ap_id(note_activity.data["object"]["id"])
242
243 {:ok, _like_activity, _object} = ActivityPub.like(user, object)
244 updated_activity = Activity.get_by_ap_id(note_activity.data["id"])
245
246 assert ActivityView.render("activity.json", activity: updated_activity)["fave_num"] == 1
247
248 {:ok, activity} = TwitterAPI.unfav(user, note_activity.id)
249
250 assert ActivityView.render("activity.json", activity: activity)["fave_num"] == 0
251 end
252
253 test "it retweets a status and returns the retweet" do
254 user = insert(:user)
255 note_activity = insert(:note_activity)
256
257 {:ok, status} = TwitterAPI.repeat(user, note_activity.id)
258 updated_activity = Activity.get_by_ap_id(note_activity.data["id"])
259
260 assert status == updated_activity
261 end
262
263 test "it unretweets an already retweeted status" do
264 user = insert(:user)
265 note_activity = insert(:note_activity)
266
267 {:ok, _status} = TwitterAPI.repeat(user, note_activity.id)
268 {:ok, status} = TwitterAPI.unrepeat(user, note_activity.id)
269 updated_activity = Activity.get_by_ap_id(note_activity.data["id"])
270
271 assert status == updated_activity
272 end
273
274 test "it registers a new user and returns the user." do
275 data = %{
276 "nickname" => "lain",
277 "email" => "lain@wired.jp",
278 "fullname" => "lain iwakura",
279 "password" => "bear",
280 "confirm" => "bear"
281 }
282
283 {:ok, user} = TwitterAPI.register_user(data)
284
285 fetched_user = User.get_by_nickname("lain")
286
287 assert UserView.render("show.json", %{user: user}) ==
288 UserView.render("show.json", %{user: fetched_user})
289 end
290
291 test "it registers a new user with empty string in bio and returns the user." do
292 data = %{
293 "nickname" => "lain",
294 "email" => "lain@wired.jp",
295 "fullname" => "lain iwakura",
296 "bio" => "",
297 "password" => "bear",
298 "confirm" => "bear"
299 }
300
301 {:ok, user} = TwitterAPI.register_user(data)
302
303 fetched_user = User.get_by_nickname("lain")
304
305 assert UserView.render("show.json", %{user: user}) ==
306 UserView.render("show.json", %{user: fetched_user})
307 end
308
309 test "it sends confirmation email if :account_activation_required is specified in instance config" do
310 setting = Pleroma.Config.get([:instance, :account_activation_required])
311
312 unless setting do
313 Pleroma.Config.put([:instance, :account_activation_required], true)
314 on_exit(fn -> Pleroma.Config.put([:instance, :account_activation_required], setting) end)
315 end
316
317 data = %{
318 "nickname" => "lain",
319 "email" => "lain@wired.jp",
320 "fullname" => "lain iwakura",
321 "bio" => "",
322 "password" => "bear",
323 "confirm" => "bear"
324 }
325
326 {:ok, user} = TwitterAPI.register_user(data)
327
328 assert user.info.confirmation_pending
329
330 email = Pleroma.Emails.UserEmail.account_confirmation_email(user)
331
332 notify_email = Pleroma.Config.get([:instance, :notify_email])
333 instance_name = Pleroma.Config.get([:instance, :name])
334
335 Swoosh.TestAssertions.assert_email_sent(
336 from: {instance_name, notify_email},
337 to: {user.name, user.email},
338 html_body: email.html_body
339 )
340 end
341
342 test "it registers a new user and parses mentions in the bio" do
343 data1 = %{
344 "nickname" => "john",
345 "email" => "john@gmail.com",
346 "fullname" => "John Doe",
347 "bio" => "test",
348 "password" => "bear",
349 "confirm" => "bear"
350 }
351
352 {:ok, user1} = TwitterAPI.register_user(data1)
353
354 data2 = %{
355 "nickname" => "lain",
356 "email" => "lain@wired.jp",
357 "fullname" => "lain iwakura",
358 "bio" => "@john test",
359 "password" => "bear",
360 "confirm" => "bear"
361 }
362
363 {:ok, user2} = TwitterAPI.register_user(data2)
364
365 expected_text =
366 "<span class='h-card'><a data-user='#{user1.id}' class='u-url mention' href='#{user1.ap_id}'>@<span>john</span></a></span> test"
367
368 assert user2.bio == expected_text
369 end
370
371 describe "register with one time token" do
372 setup do
373 setting = Pleroma.Config.get([:instance, :registrations_open])
374
375 if setting do
376 Pleroma.Config.put([:instance, :registrations_open], false)
377 on_exit(fn -> Pleroma.Config.put([:instance, :registrations_open], setting) end)
378 end
379
380 :ok
381 end
382
383 test "returns user on success" do
384 {:ok, invite} = UserInviteToken.create_invite()
385
386 data = %{
387 "nickname" => "vinny",
388 "email" => "pasta@pizza.vs",
389 "fullname" => "Vinny Vinesauce",
390 "bio" => "streamer",
391 "password" => "hiptofbees",
392 "confirm" => "hiptofbees",
393 "token" => invite.token
394 }
395
396 {:ok, user} = TwitterAPI.register_user(data)
397
398 fetched_user = User.get_by_nickname("vinny")
399 invite = Repo.get_by(UserInviteToken, token: invite.token)
400
401 assert invite.used == true
402
403 assert UserView.render("show.json", %{user: user}) ==
404 UserView.render("show.json", %{user: fetched_user})
405 end
406
407 test "returns error on invalid token" do
408 data = %{
409 "nickname" => "GrimReaper",
410 "email" => "death@reapers.afterlife",
411 "fullname" => "Reaper Grim",
412 "bio" => "Your time has come",
413 "password" => "scythe",
414 "confirm" => "scythe",
415 "token" => "DudeLetMeInImAFairy"
416 }
417
418 {:error, msg} = TwitterAPI.register_user(data)
419
420 assert msg == "Invalid token"
421 refute User.get_by_nickname("GrimReaper")
422 end
423
424 test "returns error on expired token" do
425 {:ok, invite} = UserInviteToken.create_invite()
426 UserInviteToken.update_invite!(invite, used: true)
427
428 data = %{
429 "nickname" => "GrimReaper",
430 "email" => "death@reapers.afterlife",
431 "fullname" => "Reaper Grim",
432 "bio" => "Your time has come",
433 "password" => "scythe",
434 "confirm" => "scythe",
435 "token" => invite.token
436 }
437
438 {:error, msg} = TwitterAPI.register_user(data)
439
440 assert msg == "Expired token"
441 refute User.get_by_nickname("GrimReaper")
442 end
443 end
444
445 describe "registers with date limited token" do
446 setup do
447 setting = Pleroma.Config.get([:instance, :registrations_open])
448
449 if setting do
450 Pleroma.Config.put([:instance, :registrations_open], false)
451 on_exit(fn -> Pleroma.Config.put([:instance, :registrations_open], setting) end)
452 end
453
454 data = %{
455 "nickname" => "vinny",
456 "email" => "pasta@pizza.vs",
457 "fullname" => "Vinny Vinesauce",
458 "bio" => "streamer",
459 "password" => "hiptofbees",
460 "confirm" => "hiptofbees"
461 }
462
463 check_fn = fn invite ->
464 data = Map.put(data, "token", invite.token)
465 {:ok, user} = TwitterAPI.register_user(data)
466 fetched_user = User.get_by_nickname("vinny")
467
468 assert UserView.render("show.json", %{user: user}) ==
469 UserView.render("show.json", %{user: fetched_user})
470 end
471
472 {:ok, data: data, check_fn: check_fn}
473 end
474
475 test "returns user on success", %{check_fn: check_fn} do
476 {:ok, invite} = UserInviteToken.create_invite(%{expires_at: Date.utc_today()})
477
478 check_fn.(invite)
479
480 invite = Repo.get_by(UserInviteToken, token: invite.token)
481
482 refute invite.used
483 end
484
485 test "returns user on token which expired tomorrow", %{check_fn: check_fn} do
486 {:ok, invite} = UserInviteToken.create_invite(%{expires_at: Date.add(Date.utc_today(), 1)})
487
488 check_fn.(invite)
489
490 invite = Repo.get_by(UserInviteToken, token: invite.token)
491
492 refute invite.used
493 end
494
495 test "returns an error on overdue date", %{data: data} do
496 {:ok, invite} = UserInviteToken.create_invite(%{expires_at: Date.add(Date.utc_today(), -1)})
497
498 data = Map.put(data, "token", invite.token)
499
500 {:error, msg} = TwitterAPI.register_user(data)
501
502 assert msg == "Expired token"
503 refute User.get_by_nickname("vinny")
504 invite = Repo.get_by(UserInviteToken, token: invite.token)
505
506 refute invite.used
507 end
508 end
509
510 describe "registers with reusable token" do
511 setup do
512 setting = Pleroma.Config.get([:instance, :registrations_open])
513
514 if setting do
515 Pleroma.Config.put([:instance, :registrations_open], false)
516 on_exit(fn -> Pleroma.Config.put([:instance, :registrations_open], setting) end)
517 end
518
519 :ok
520 end
521
522 test "returns user on success, after him registration fails" do
523 {:ok, invite} = UserInviteToken.create_invite(%{max_use: 100})
524
525 UserInviteToken.update_invite!(invite, uses: 99)
526
527 data = %{
528 "nickname" => "vinny",
529 "email" => "pasta@pizza.vs",
530 "fullname" => "Vinny Vinesauce",
531 "bio" => "streamer",
532 "password" => "hiptofbees",
533 "confirm" => "hiptofbees",
534 "token" => invite.token
535 }
536
537 {:ok, user} = TwitterAPI.register_user(data)
538 fetched_user = User.get_by_nickname("vinny")
539 invite = Repo.get_by(UserInviteToken, token: invite.token)
540
541 assert invite.used == true
542
543 assert UserView.render("show.json", %{user: user}) ==
544 UserView.render("show.json", %{user: fetched_user})
545
546 data = %{
547 "nickname" => "GrimReaper",
548 "email" => "death@reapers.afterlife",
549 "fullname" => "Reaper Grim",
550 "bio" => "Your time has come",
551 "password" => "scythe",
552 "confirm" => "scythe",
553 "token" => invite.token
554 }
555
556 {:error, msg} = TwitterAPI.register_user(data)
557
558 assert msg == "Expired token"
559 refute User.get_by_nickname("GrimReaper")
560 end
561 end
562
563 describe "registers with reusable date limited token" do
564 setup do
565 setting = Pleroma.Config.get([:instance, :registrations_open])
566
567 if setting do
568 Pleroma.Config.put([:instance, :registrations_open], false)
569 on_exit(fn -> Pleroma.Config.put([:instance, :registrations_open], setting) end)
570 end
571
572 :ok
573 end
574
575 test "returns user on success" do
576 {:ok, invite} = UserInviteToken.create_invite(%{expires_at: Date.utc_today(), max_use: 100})
577
578 data = %{
579 "nickname" => "vinny",
580 "email" => "pasta@pizza.vs",
581 "fullname" => "Vinny Vinesauce",
582 "bio" => "streamer",
583 "password" => "hiptofbees",
584 "confirm" => "hiptofbees",
585 "token" => invite.token
586 }
587
588 {:ok, user} = TwitterAPI.register_user(data)
589 fetched_user = User.get_by_nickname("vinny")
590 invite = Repo.get_by(UserInviteToken, token: invite.token)
591
592 refute invite.used
593
594 assert UserView.render("show.json", %{user: user}) ==
595 UserView.render("show.json", %{user: fetched_user})
596 end
597
598 test "error after max uses" do
599 {:ok, invite} = UserInviteToken.create_invite(%{expires_at: Date.utc_today(), max_use: 100})
600
601 UserInviteToken.update_invite!(invite, uses: 99)
602
603 data = %{
604 "nickname" => "vinny",
605 "email" => "pasta@pizza.vs",
606 "fullname" => "Vinny Vinesauce",
607 "bio" => "streamer",
608 "password" => "hiptofbees",
609 "confirm" => "hiptofbees",
610 "token" => invite.token
611 }
612
613 {:ok, user} = TwitterAPI.register_user(data)
614 fetched_user = User.get_by_nickname("vinny")
615 invite = Repo.get_by(UserInviteToken, token: invite.token)
616 assert invite.used == true
617
618 assert UserView.render("show.json", %{user: user}) ==
619 UserView.render("show.json", %{user: fetched_user})
620
621 data = %{
622 "nickname" => "GrimReaper",
623 "email" => "death@reapers.afterlife",
624 "fullname" => "Reaper Grim",
625 "bio" => "Your time has come",
626 "password" => "scythe",
627 "confirm" => "scythe",
628 "token" => invite.token
629 }
630
631 {:error, msg} = TwitterAPI.register_user(data)
632
633 assert msg == "Expired token"
634 refute User.get_by_nickname("GrimReaper")
635 end
636
637 test "returns error on overdue date" do
638 {:ok, invite} =
639 UserInviteToken.create_invite(%{expires_at: Date.add(Date.utc_today(), -1), max_use: 100})
640
641 data = %{
642 "nickname" => "GrimReaper",
643 "email" => "death@reapers.afterlife",
644 "fullname" => "Reaper Grim",
645 "bio" => "Your time has come",
646 "password" => "scythe",
647 "confirm" => "scythe",
648 "token" => invite.token
649 }
650
651 {:error, msg} = TwitterAPI.register_user(data)
652
653 assert msg == "Expired token"
654 refute User.get_by_nickname("GrimReaper")
655 end
656
657 test "returns error on with overdue date and after max" do
658 {:ok, invite} =
659 UserInviteToken.create_invite(%{expires_at: Date.add(Date.utc_today(), -1), max_use: 100})
660
661 UserInviteToken.update_invite!(invite, uses: 100)
662
663 data = %{
664 "nickname" => "GrimReaper",
665 "email" => "death@reapers.afterlife",
666 "fullname" => "Reaper Grim",
667 "bio" => "Your time has come",
668 "password" => "scythe",
669 "confirm" => "scythe",
670 "token" => invite.token
671 }
672
673 {:error, msg} = TwitterAPI.register_user(data)
674
675 assert msg == "Expired token"
676 refute User.get_by_nickname("GrimReaper")
677 end
678 end
679
680 test "it returns the error on registration problems" do
681 data = %{
682 "nickname" => "lain",
683 "email" => "lain@wired.jp",
684 "fullname" => "lain iwakura",
685 "bio" => "close the world.",
686 "password" => "bear"
687 }
688
689 {:error, error_object} = TwitterAPI.register_user(data)
690
691 assert is_binary(error_object[:error])
692 refute User.get_by_nickname("lain")
693 end
694
695 test "it assigns an integer conversation_id" do
696 note_activity = insert(:note_activity)
697 status = ActivityView.render("activity.json", activity: note_activity)
698
699 assert is_number(status["statusnet_conversation_id"])
700 end
701
702 setup do
703 Supervisor.terminate_child(Pleroma.Supervisor, Cachex)
704 Supervisor.restart_child(Pleroma.Supervisor, Cachex)
705 :ok
706 end
707
708 describe "fetching a user by uri" do
709 test "fetches a user by uri" do
710 id = "https://mastodon.social/users/lambadalambda"
711 user = insert(:user)
712 {:ok, represented} = TwitterAPI.get_external_profile(user, id)
713 remote = User.get_by_ap_id(id)
714
715 assert represented["id"] == UserView.render("show.json", %{user: remote, for: user})["id"]
716
717 # Also fetches the feed.
718 # assert Activity.get_create_by_object_ap_id("tag:mastodon.social,2017-04-05:objectId=1641750:objectType=Status")
719 # credo:disable-for-previous-line Credo.Check.Readability.MaxLineLength
720 end
721 end
722 end