logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 9223038319f0281f104fb9bb85c0cb8f6e52984a
parent 79b3397c17ec0ac53b2ec3e33a5bcd800397baae
Author: eal <eal@waifu.club>
Date:   Mon, 11 Dec 2017 21:01:36 +0200

Fix some more tests.

Diffstat:

Mtest/web/mastodon_api/status_view_test.exs4+++-
Mtest/web/twitter_api/views/user_view_test.exs4++--
2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/test/web/mastodon_api/status_view_test.exs b/test/web/mastodon_api/status_view_test.exs @@ -56,7 +56,9 @@ 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}) {:ok, [activity]} = OStatus.handle_incoming(incoming) diff --git a/test/web/twitter_api/views/user_view_test.exs b/test/web/twitter_api/views/user_view_test.exs @@ -30,8 +30,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do User.follow(follower, user) User.follow(second_follower, user) User.follow(user, follower) - - user = Repo.get!(User, user.id) + {:ok, user} = User.update_follower_count(user) + Cachex.set(:user_cache, "user_info:#{user.id}", User.user_info(Repo.get!(User, user.id))) image = "https://placehold.it/48x48"