diff options
author | lain <lain@soykaf.club> | 2018-03-22 12:44:32 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2018-03-22 12:44:32 +0100 |
commit | 32ae9188430349e22721b81baec825b3cebfe8e5 (patch) | |
tree | b713f0a3990324039c86e8f4303ab8694360d419 | |
parent | f9ab38a443be37fc49a4fb52dece8a1d44c44e13 (diff) | |
download | pleroma-32ae9188430349e22721b81baec825b3cebfe8e5.tar.gz |
Clear caches on test.
-rw-r--r-- | test/support/conn_case.ex | 1 | ||||
-rw-r--r-- | test/support/data_case.ex | 1 | ||||
-rw-r--r-- | test/web/mastodon_api/status_view_test.exs | 5 |
3 files changed, 3 insertions, 4 deletions
diff --git a/test/support/conn_case.ex b/test/support/conn_case.ex index 8d6969855..a83ef3b3a 100644 --- a/test/support/conn_case.ex +++ b/test/support/conn_case.ex @@ -28,6 +28,7 @@ defmodule Pleroma.Web.ConnCase do setup tags do + Cachex.clear(:user_cache) :ok = Ecto.Adapters.SQL.Sandbox.checkout(Pleroma.Repo) unless tags[:async] do Ecto.Adapters.SQL.Sandbox.mode(Pleroma.Repo, {:shared, self()}) diff --git a/test/support/data_case.ex b/test/support/data_case.ex index 3f40c3670..8eff0fd94 100644 --- a/test/support/data_case.ex +++ b/test/support/data_case.ex @@ -26,6 +26,7 @@ defmodule Pleroma.DataCase do end setup tags do + Cachex.clear(:user_cache) :ok = Ecto.Adapters.SQL.Sandbox.checkout(Pleroma.Repo) unless tags[:async] do diff --git a/test/web/mastodon_api/status_view_test.exs b/test/web/mastodon_api/status_view_test.exs index 9e2bc3c18..a58f729a6 100644 --- a/test/web/mastodon_api/status_view_test.exs +++ b/test/web/mastodon_api/status_view_test.exs @@ -58,10 +58,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do incoming = File.read!("test/fixtures/incoming_reply_mastodon.xml") # a user with this ap id might be in the cache. recipient = "https://pleroma.soykaf.com/users/lain" - user = User.get_cached_by_ap_id(recipient) || insert(:user, %{ap_id: recipient}) - - # invalidate the cache - User.invalidate_cache(user) + user = insert(:user, %{ap_id: recipient}) {:ok, [activity]} = OStatus.handle_incoming(incoming) |