X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Factivity%2Fsearch_test.exs;h=657fbc627ab29c7a4632d2f4d1a0391fea1e5071;hb=4a6b49d0b4529936b06a3f1668d937220fb2173b;hp=37c0feeeab04d38ee9874241659562a2d34d1221;hpb=9a1e5f5d48ef9f3b5a817c02dc8820aa99a6f693;p=akkoma
diff --git a/test/pleroma/activity/search_test.exs b/test/pleroma/activity/search_test.exs
index 37c0feeea..657fbc627 100644
--- a/test/pleroma/activity/search_test.exs
+++ b/test/pleroma/activity/search_test.exs
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Activity.SearchTest do
@@ -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)
@@ -19,8 +19,9 @@ defmodule Pleroma.Activity.SearchTest do
end
test "using plainto_tsquery on postgres < 11" do
- old_config = Application.get_env(:postgres, :version)
- Application.put_env(:postgres, :version, 10.0)
+ old_version = :persistent_term.get({Pleroma.Repo, :postgres_version})
+ :persistent_term.put({Pleroma.Repo, :postgres_version}, 10.0)
+ on_exit(fn -> :persistent_term.put({Pleroma.Repo, :postgres_version}, old_version) end)
user = insert(:user)
{:ok, post} = CommonAPI.post(user, %{status: "it's wednesday my dudes"})
@@ -30,8 +31,6 @@ defmodule Pleroma.Activity.SearchTest do
assert [result] = Search.search(nil, "wednesday -dudes")
assert result.id == post.id
-
- Application.put_env(:postgres, :version, old_config)
end
test "using websearch_to_tsquery" do