Merge branch 'feld-mastoweb5000' into 'develop'
[akkoma] / test / web / mastodon_api / status_view_test.exs
index 93c0b7236ec7cefd3742a09cfc78283bef7fe369..9e2bc3c185ce8bf4eb2d70b1aaf4b412ed76b604 100644 (file)
@@ -56,7 +56,12 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
 
   test "contains mentions" do
     incoming = File.read!("test/fixtures/incoming_reply_mastodon.xml")
-    user = insert(:user, %{ap_id: "https://pleroma.soykaf.com/users/lain"})
+    # 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)
 
     {:ok, [activity]} = OStatus.handle_incoming(incoming)