diff options
author | lain <lain@soykaf.club> | 2020-11-23 15:29:55 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-11-23 15:29:55 +0100 |
commit | 67b15cc033fd1154d1e6a96a5c5f141921c2e688 (patch) | |
tree | 288d8dfa79ca97e1f46c51948eeb8b7da5d8998a /test | |
parent | f9a4cf2097c0ccc3987517b581aebc1197b2a4a3 (diff) | |
download | pleroma-67b15cc033fd1154d1e6a96a5c5f141921c2e688.tar.gz |
Search: Save detected pg version in a persistent term.
Diffstat (limited to 'test')
-rw-r--r-- | test/pleroma/activity/search_test.exs | 6 | ||||
-rw-r--r-- | test/pleroma/web/mastodon_api/controllers/search_controller_test.exs | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/test/pleroma/activity/search_test.exs b/test/pleroma/activity/search_test.exs index 37c0feeea..988949154 100644 --- a/test/pleroma/activity/search_test.exs +++ b/test/pleroma/activity/search_test.exs @@ -19,8 +19,8 @@ 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) user = insert(:user) {:ok, post} = CommonAPI.post(user, %{status: "it's wednesday my dudes"}) @@ -31,7 +31,7 @@ defmodule Pleroma.Activity.SearchTest do assert result.id == post.id - Application.put_env(:postgres, :version, old_config) + :persistent_term.put({Pleroma.Repo, :postgres_version}, old_version) end test "using websearch_to_tsquery" do diff --git a/test/pleroma/web/mastodon_api/controllers/search_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/search_controller_test.exs index 2b2579857..2f0bce450 100644 --- a/test/pleroma/web/mastodon_api/controllers/search_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/search_controller_test.exs @@ -279,8 +279,8 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do end test "search fetches remote statuses and prefers them over other results", %{conn: conn} 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) capture_log(fn -> {:ok, %{id: activity_id}} = @@ -299,7 +299,7 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do ] = results["statuses"] end) - Application.put_env(:postgres, :version, old_config) + :persistent_term.put({Pleroma.Repo, :postgres_version}, old_version) end test "search doesn't show statuses that it shouldn't", %{conn: conn} do |