Tests: Make as many tests as possible async.

In general, tests that match these criteria can be made async:

- Doesn't use real Cachex.
- Doesn't write to the Config / Application Environment.
- Uses Mock. Using Mox is fine.
- Uses the streamer.
origin/neckbeard
lain 2 years ago
parent c9d73af74d
commit 9ba60f70d2
  1. 1
      test/mix/tasks/pleroma/count_statuses_test.exs
  2. 2
      test/mix/tasks/pleroma/database_test.exs
  3. 2
      test/mix/tasks/pleroma/ecto/rollback_test.exs
  4. 7
      test/mix/tasks/pleroma/instance_test.exs
  5. 1
      test/mix/tasks/pleroma/refresh_counter_cache_test.exs
  6. 2
      test/pleroma/activity/ir/topics_test.exs
  7. 2
      test/pleroma/activity/search_test.exs
  8. 2
      test/pleroma/bbs/handler_test.exs
  9. 2
      test/pleroma/bookmark_test.exs
  10. 2
      test/pleroma/config_test.exs
  11. 2
      test/pleroma/conversation/participation_test.exs
  12. 2
      test/pleroma/earmark_renderer_test.exs
  13. 2
      test/pleroma/ecto_type/activity_pub/object_validators/date_time_test.exs
  14. 2
      test/pleroma/ecto_type/activity_pub/object_validators/object_id_test.exs
  15. 2
      test/pleroma/ecto_type/activity_pub/object_validators/recipients_test.exs
  16. 2
      test/pleroma/ecto_type/activity_pub/object_validators/safe_text_test.exs
  17. 2
      test/pleroma/emails/admin_email_test.exs
  18. 2
      test/pleroma/emails/user_email_test.exs
  19. 2
      test/pleroma/emoji/formatter_test.exs
  20. 2
      test/pleroma/emoji/pack_test.exs
  21. 2
      test/pleroma/emoji_test.exs
  22. 2
      test/pleroma/filter_test.exs
  23. 2
      test/pleroma/following_relationship_test.exs
  24. 2
      test/pleroma/healthcheck_test.exs
  25. 2
      test/pleroma/html_test.exs
  26. 1
      test/pleroma/integration/mastodon_websocket_test.exs
  27. 2
      test/pleroma/keys_test.exs
  28. 2
      test/pleroma/list_test.exs
  29. 2
      test/pleroma/marker_test.exs
  30. 2
      test/pleroma/mfa/backup_codes_test.exs
  31. 2
      test/pleroma/mfa/totp_test.exs
  32. 2
      test/pleroma/mfa_test.exs
  33. 2
      test/pleroma/migration_helper/notification_backfill_test.exs
  34. 2
      test/pleroma/moderation_log_test.exs
  35. 2
      test/pleroma/pagination_test.exs
  36. 2
      test/pleroma/registration_test.exs
  37. 2
      test/pleroma/repo/migrations/fix_legacy_tags_test.exs
  38. 2
      test/pleroma/repo/migrations/move_welcome_settings_test.exs
  39. 2
      test/pleroma/repo_test.exs
  40. 2
      test/pleroma/report_note_test.exs
  41. 2
      test/pleroma/safe_jsonb_set_test.exs
  42. 2
      test/pleroma/stats_test.exs
  43. 2
      test/pleroma/upload/filter/dedupe_test.exs
  44. 2
      test/pleroma/upload/filter/exiftool_test.exs
  45. 2
      test/pleroma/uploaders/local_test.exs
  46. 2
      test/pleroma/user/notification_setting_test.exs
  47. 2
      test/pleroma/user/query_test.exs
  48. 2
      test/pleroma/user_relationship_test.exs
  49. 2
      test/pleroma/web/activity_pub/mrf/anti_followbot_policy_test.exs
  50. 2
      test/pleroma/web/activity_pub/mrf/ensure_re_prepended_test.exs
  51. 2
      test/pleroma/web/activity_pub/mrf/force_bot_unlisted_policy_test.exs
  52. 2
      test/pleroma/web/activity_pub/mrf/no_placeholder_text_policy_test.exs
  53. 2
      test/pleroma/web/activity_pub/mrf/normalize_markup_test.exs
  54. 2
      test/pleroma/web/activity_pub/mrf/tag_policy_test.exs
  55. 2
      test/pleroma/web/activity_pub/object_validators/accept_validation_test.exs
  56. 2
      test/pleroma/web/activity_pub/object_validators/announce_validation_test.exs
  57. 2
      test/pleroma/web/activity_pub/object_validators/article_note_validator_test.exs
  58. 2
      test/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs
  59. 2
      test/pleroma/web/activity_pub/object_validators/block_validation_test.exs
  60. 2
      test/pleroma/web/activity_pub/object_validators/delete_validation_test.exs
  61. 2
      test/pleroma/web/activity_pub/object_validators/emoji_react_handling_test.exs
  62. 2
      test/pleroma/web/activity_pub/object_validators/follow_validation_test.exs
  63. 2
      test/pleroma/web/activity_pub/object_validators/like_validation_test.exs
  64. 2
      test/pleroma/web/activity_pub/object_validators/reject_validation_test.exs
  65. 2
      test/pleroma/web/activity_pub/object_validators/undo_handling_test.exs
  66. 2
      test/pleroma/web/activity_pub/object_validators/update_handling_test.exs
  67. 2
      test/pleroma/web/activity_pub/transmogrifier/accept_handling_test.exs
  68. 2
      test/pleroma/web/activity_pub/transmogrifier/block_handling_test.exs
  69. 2
      test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs
  70. 2
      test/pleroma/web/activity_pub/transmogrifier/like_handling_test.exs
  71. 2
      test/pleroma/web/activity_pub/transmogrifier/reject_handling_test.exs
  72. 2
      test/pleroma/web/activity_pub/transmogrifier/undo_handling_test.exs
  73. 2
      test/pleroma/web/activity_pub/transmogrifier/user_update_handling_test.exs
  74. 2
      test/pleroma/web/activity_pub/utils_test.exs
  75. 2
      test/pleroma/web/activity_pub/views/user_view_test.exs
  76. 2
      test/pleroma/web/activity_pub/visibility_test.exs
  77. 2
      test/pleroma/web/admin_api/controllers/chat_controller_test.exs
  78. 2
      test/pleroma/web/admin_api/controllers/report_controller_test.exs
  79. 2
      test/pleroma/web/admin_api/controllers/status_controller_test.exs
  80. 2
      test/pleroma/web/admin_api/search_test.exs
  81. 2
      test/pleroma/web/admin_api/views/moderation_log_view_test.exs
  82. 2
      test/pleroma/web/admin_api/views/report_view_test.exs
  83. 2
      test/pleroma/web/auth/authenticator_test.exs
  84. 2
      test/pleroma/web/auth/basic_auth_test.exs
  85. 2
      test/pleroma/web/auth/pleroma_authenticator_test.exs
  86. 2
      test/pleroma/web/auth/totp_authenticator_test.exs
  87. 1
      test/pleroma/web/endpoint/metrics_exporter_test.exs
  88. 2
      test/pleroma/web/mastodon_api/controllers/auth_controller_test.exs
  89. 2
      test/pleroma/web/mastodon_api/controllers/conversation_controller_test.exs
  90. 2
      test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs
  91. 2
      test/pleroma/web/mastodon_api/controllers/follow_request_controller_test.exs
  92. 2
      test/pleroma/web/mastodon_api/controllers/list_controller_test.exs
  93. 2
      test/pleroma/web/mastodon_api/controllers/marker_controller_test.exs
  94. 2
      test/pleroma/web/mastodon_api/controllers/poll_controller_test.exs
  95. 2
      test/pleroma/web/mastodon_api/controllers/report_controller_test.exs
  96. 2
      test/pleroma/web/mastodon_api/controllers/subscription_controller_test.exs
  97. 2
      test/pleroma/web/mastodon_api/controllers/suggestion_controller_test.exs
  98. 2
      test/pleroma/web/mastodon_api/mastodon_api_controller_test.exs
  99. 2
      test/pleroma/web/mastodon_api/mastodon_api_test.exs
  100. 2
      test/pleroma/web/mastodon_api/views/conversation_view_test.exs
  101. Some files were not shown because too many files have changed in this diff Show More

@ -3,6 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.CountStatusesTest do
# Uses log capture, has to stay synchronous
use Pleroma.DataCase
alias Pleroma.User

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.DatabaseTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
use Oban.Testing, repo: Pleroma.Repo
alias Pleroma.Activity

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.Ecto.RollbackTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
import ExUnit.CaptureLog
require Logger

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.InstanceTest do
use ExUnit.Case
use Pleroma.DataCase, async: true
setup do
File.mkdir_p!(tmp_path())
@ -15,15 +15,14 @@ defmodule Mix.Tasks.Pleroma.InstanceTest do
if File.exists?(static_dir) do
File.rm_rf(Path.join(static_dir, "robots.txt"))
end
Pleroma.Config.put([:instance, :static_dir], static_dir)
end)
:ok
end
@uuid Ecto.UUID.generate()
defp tmp_path do
"/tmp/generated_files/"
"/tmp/generated_files/#{@uuid}/"
end
test "running gen" do

@ -3,6 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.RefreshCounterCacheTest do
# Uses log capture, has to stay synchronous
use Pleroma.DataCase
alias Pleroma.Web.CommonAPI
import ExUnit.CaptureIO, only: [capture_io: 1]

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Activity.Ir.TopicsTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Activity
alias Pleroma.Activity.Ir.Topics

@ -7,7 +7,7 @@ defmodule Pleroma.Activity.SearchTest do
alias Pleroma.Web.CommonAPI
import Pleroma.Factory
use Pleroma.DataCase
use Pleroma.DataCase, async: true
test "it finds something" do
user = insert(:user)

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.BBS.HandlerTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Activity
alias Pleroma.BBS.Handler
alias Pleroma.Object

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.BookmarkTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
import Pleroma.Factory
alias Pleroma.Bookmark
alias Pleroma.Web.CommonAPI

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.ConfigTest do
use ExUnit.Case
use Pleroma.DataCase, async: true
test "get/1 with an atom" do
assert Pleroma.Config.get(:instance) == Application.get_env(:pleroma, :instance)

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Conversation.ParticipationTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
import Pleroma.Factory
alias Pleroma.Conversation
alias Pleroma.Conversation.Participation

@ -2,7 +2,7 @@
# Copyright © 2020 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.EarmarkRendererTest do
use ExUnit.Case
use Pleroma.DataCase, async: true
test "Paragraph" do
code = ~s[Hello\n\nWorld!]

@ -4,7 +4,7 @@
defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.DateTimeTest do
alias Pleroma.EctoType.ActivityPub.ObjectValidators.DateTime
use Pleroma.DataCase
use Pleroma.DataCase, async: true
test "it validates an xsd:Datetime" do
valid_strings = [

@ -4,7 +4,7 @@
defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.ObjectIDTest do
alias Pleroma.EctoType.ActivityPub.ObjectValidators.ObjectID
use Pleroma.DataCase
use Pleroma.DataCase, async: true
@uris [
"http://lain.com/users/lain",

@ -4,7 +4,7 @@
defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.RecipientsTest do
alias Pleroma.EctoType.ActivityPub.ObjectValidators.Recipients
use Pleroma.DataCase
use Pleroma.DataCase, async: true
test "it asserts that all elements of the list are object ids" do
list = ["https://lain.com/users/lain", "invalid"]

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.SafeTextTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.EctoType.ActivityPub.ObjectValidators.SafeText

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Emails.AdminEmailTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
import Pleroma.Factory
alias Pleroma.Emails.AdminEmail

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Emails.UserEmailTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Emails.UserEmail
alias Pleroma.Web.Endpoint

@ -4,7 +4,7 @@
defmodule Pleroma.Emoji.FormatterTest do
alias Pleroma.Emoji.Formatter
use Pleroma.DataCase
use Pleroma.DataCase, async: true
describe "emojify" do
test "it adds cool emoji" do

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Emoji.PackTest do
use ExUnit.Case, async: true
use Pleroma.DataCase
alias Pleroma.Emoji.Pack
@emoji_path Path.join(

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.EmojiTest do
use ExUnit.Case
use ExUnit.Case, async: true
alias Pleroma.Emoji
describe "is_unicode_emoji?/1" do

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.FilterTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
import Pleroma.Factory

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.FollowingRelationshipTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.FollowingRelationship
alias Pleroma.Web.ActivityPub.InternalFetchActor

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.HealthcheckTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Healthcheck
test "system_info/0" do

@ -6,7 +6,7 @@ defmodule Pleroma.HTMLTest do
alias Pleroma.HTML
alias Pleroma.Object
alias Pleroma.Web.CommonAPI
use Pleroma.DataCase
use Pleroma.DataCase, async: true
import Pleroma.Factory

@ -3,6 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Integration.MastodonWebsocketTest do
# Needs a streamer, needs to stay synchronous
use Pleroma.DataCase
import ExUnit.CaptureLog

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.KeysTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Keys

@ -4,7 +4,7 @@
defmodule Pleroma.ListTest do
alias Pleroma.Repo
use Pleroma.DataCase
use Pleroma.DataCase, async: true
import Pleroma.Factory

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.MarkerTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Marker
import Pleroma.Factory

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.MFA.BackupCodesTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.MFA.BackupCodes

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.MFA.TOTPTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.MFA.TOTP

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.MFATest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
import Pleroma.Factory
alias Pleroma.MFA

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.MigrationHelper.NotificationBackfillTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Activity
alias Pleroma.MigrationHelper.NotificationBackfill

@ -6,7 +6,7 @@ defmodule Pleroma.ModerationLogTest do
alias Pleroma.Activity
alias Pleroma.ModerationLog
use Pleroma.DataCase
use Pleroma.DataCase, async: true
import Pleroma.Factory

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.PaginationTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
import Pleroma.Factory

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.RegistrationTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
import Pleroma.Factory

@ -4,7 +4,7 @@
defmodule Pleroma.Repo.Migrations.FixLegacyTagsTest do
alias Pleroma.User
use Pleroma.DataCase
use Pleroma.DataCase, async: true
import Pleroma.Factory
import Pleroma.Tests.Helpers

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Repo.Migrations.MoveWelcomeSettingsTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
import Pleroma.Factory
import Pleroma.Tests.Helpers
alias Pleroma.ConfigDB

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.RepoTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
import Pleroma.Factory
alias Pleroma.User

@ -4,7 +4,7 @@
defmodule Pleroma.ReportNoteTest do
alias Pleroma.ReportNote
use Pleroma.DataCase
use Pleroma.DataCase, async: true
import Pleroma.Factory
test "create/3" do

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.SafeJsonbSetTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
test "it doesn't wipe the object when asked to set the value to NULL" do
assert %{rows: [[%{"key" => "value", "test" => nil}]]} =

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.StatsTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
import Pleroma.Factory

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Upload.Filter.DedupeTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Upload
alias Pleroma.Upload.Filter.Dedupe

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Upload.Filter.ExiftoolTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Upload.Filter
test "apply exiftool filter" do

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Uploaders.LocalTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Uploaders.Local
describe "get_file/1" do

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.User.NotificationSettingTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.User.NotificationSetting

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.User.QueryTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Repo
alias Pleroma.User

@ -5,7 +5,7 @@
defmodule Pleroma.UserRelationshipTest do
alias Pleroma.UserRelationship
use Pleroma.DataCase
use Pleroma.DataCase, async: true
import Pleroma.Factory

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.MRF.AntiFollowbotPolicyTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
import Pleroma.Factory
alias Pleroma.Web.ActivityPub.MRF.AntiFollowbotPolicy

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.MRF.EnsureRePrependedTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Activity
alias Pleroma.Object

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.MRF.ForceBotUnlistedPolicyTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
import Pleroma.Factory
alias Pleroma.Web.ActivityPub.MRF.ForceBotUnlistedPolicy

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.MRF.NoPlaceholderTextPolicyTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Web.ActivityPub.MRF.NoPlaceholderTextPolicy
test "it clears content object" do

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.MRF.NormalizeMarkupTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Web.ActivityPub.MRF.NormalizeMarkup
@html_sample """

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.MRF.TagPolicyTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
import Pleroma.Factory
alias Pleroma.Web.ActivityPub.MRF.TagPolicy

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.ObjectValidators.AcceptValidationTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Web.ActivityPub.Builder
alias Pleroma.Web.ActivityPub.ObjectValidator

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.ObjectValidators.AnnounceValidationTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Object
alias Pleroma.Web.ActivityPub.Builder

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.ObjectValidators.ArticleNoteValidatorTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Web.ActivityPub.ObjectValidators.ArticleNoteValidator
alias Pleroma.Web.ActivityPub.Utils

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.ObjectValidators.AttachmentValidatorTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Web.ActivityPub.ActivityPub
alias Pleroma.Web.ActivityPub.ObjectValidators.AttachmentValidator

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.ObjectValidators.BlockValidationTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Web.ActivityPub.Builder
alias Pleroma.Web.ActivityPub.ObjectValidator

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.ObjectValidators.DeleteValidationTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Object
alias Pleroma.Web.ActivityPub.Builder

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.ObjectValidators.EmojiReactHandlingTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Web.ActivityPub.Builder
alias Pleroma.Web.ActivityPub.ObjectValidator

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.ObjectValidators.FollowValidationTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Web.ActivityPub.Builder
alias Pleroma.Web.ActivityPub.ObjectValidator

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.ObjectValidators.LikeValidationTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Web.ActivityPub.ObjectValidator
alias Pleroma.Web.ActivityPub.ObjectValidators.LikeValidator

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.ObjectValidators.RejectValidationTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Web.ActivityPub.Builder
alias Pleroma.Web.ActivityPub.ObjectValidator

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.ObjectValidators.UndoHandlingTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Web.ActivityPub.Builder
alias Pleroma.Web.ActivityPub.ObjectValidator

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.ObjectValidators.UpdateHandlingTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Web.ActivityPub.Builder
alias Pleroma.Web.ActivityPub.ObjectValidator

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.Transmogrifier.AcceptHandlingTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.User
alias Pleroma.Web.ActivityPub.Transmogrifier

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.Transmogrifier.BlockHandlingTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Activity
alias Pleroma.User

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.Transmogrifier.EmojiReactHandlingTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Activity
alias Pleroma.Object

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.Transmogrifier.LikeHandlingTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Activity
alias Pleroma.Web.ActivityPub.Transmogrifier

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.Transmogrifier.RejectHandlingTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Activity
alias Pleroma.User

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.Transmogrifier.UndoHandlingTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Activity
alias Pleroma.Object

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.Transmogrifier.UserUpdateHandlingTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Activity
alias Pleroma.User

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.UtilsTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Activity
alias Pleroma.Object
alias Pleroma.Repo

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.UserViewTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
import Pleroma.Factory
alias Pleroma.User

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.VisibilityTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Activity
alias Pleroma.Web.ActivityPub.Visibility

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.AdminAPI.ChatControllerTest do
use Pleroma.Web.ConnCase
use Pleroma.Web.ConnCase, async: true
import Pleroma.Factory

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.AdminAPI.ReportControllerTest do
use Pleroma.Web.ConnCase
use Pleroma.Web.ConnCase, async: true
import Pleroma.Factory

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.AdminAPI.StatusControllerTest do
use Pleroma.Web.ConnCase
use Pleroma.Web.ConnCase, async: true
import Pleroma.Factory

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.AdminAPI.SearchTest do
use Pleroma.Web.ConnCase
use Pleroma.Web.ConnCase, async: true
alias Pleroma.Web.AdminAPI.Search

@ -2,7 +2,7 @@
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.AdminAPI.ModerationLogViewTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
alias Pleroma.Web.AdminAPI.ModerationLogView

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.AdminAPI.ReportViewTest do
use Pleroma.DataCase
use Pleroma.DataCase, async: true
import Pleroma.Factory

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Auth.AuthenticatorTest do
use Pleroma.Web.ConnCase
use Pleroma.Web.ConnCase, async: true
alias Pleroma.Web.Auth.Authenticator
import Pleroma.Factory

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Auth.BasicAuthTest do
use Pleroma.Web.ConnCase
use Pleroma.Web.ConnCase, async: true
import Pleroma.Factory

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Auth.PleromaAuthenticatorTest do
use Pleroma.Web.ConnCase
use Pleroma.Web.ConnCase, async: true
alias Pleroma.Web.Auth.PleromaAuthenticator
import Pleroma.Factory

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Auth.TOTPAuthenticatorTest do
use Pleroma.Web.ConnCase
use Pleroma.Web.ConnCase, async: true
alias Pleroma.MFA
alias Pleroma.MFA.BackupCodes

@ -3,6 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Endpoint.MetricsExporterTest do
# Modifies AppEnv, has to stay synchronous
use Pleroma.Web.ConnCase
alias Pleroma.Web.Endpoint.MetricsExporter

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.MastodonAPI.AuthControllerTest do
use Pleroma.Web.ConnCase
use Pleroma.Web.ConnCase, async: true
alias Pleroma.Config
alias Pleroma.Repo

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.MastodonAPI.ConversationControllerTest do
use Pleroma.Web.ConnCase
use Pleroma.Web.ConnCase, async: true
alias Pleroma.Conversation.Participation
alias Pleroma.User

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.MastodonAPI.FilterControllerTest do
use Pleroma.Web.ConnCase
use Pleroma.Web.ConnCase, async: true
alias Pleroma.Web.MastodonAPI.FilterView

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.MastodonAPI.FollowRequestControllerTest do
use Pleroma.Web.ConnCase
use Pleroma.Web.ConnCase, async: true
alias Pleroma.User
alias Pleroma.Web.CommonAPI

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.MastodonAPI.ListControllerTest do
use Pleroma.Web.ConnCase
use Pleroma.Web.ConnCase, async: true
alias Pleroma.Repo