test: fix mastodon api test failure
This commit is contained in:
parent
3b8e5bcbeb
commit
6f5f589f73
|
@ -2,21 +2,21 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
|
||||||
use Pleroma.DataCase
|
use Pleroma.DataCase
|
||||||
|
|
||||||
alias Pleroma.Web.MastodonAPI.{StatusView, AccountView}
|
alias Pleroma.Web.MastodonAPI.{StatusView, AccountView}
|
||||||
alias Pleroma.User
|
alias Pleroma.{Repo, User, Object}
|
||||||
alias Pleroma.Web.OStatus
|
alias Pleroma.Web.OStatus
|
||||||
alias Pleroma.Web.CommonAPI
|
alias Pleroma.Web.CommonAPI
|
||||||
import Pleroma.Factory
|
import Pleroma.Factory
|
||||||
|
|
||||||
test "a note with null content" do
|
test "a note with null content" do
|
||||||
note = insert(:note_activity)
|
note = insert(:note_activity)
|
||||||
|
note_object = Object.normalize(note.data["object"])
|
||||||
|
|
||||||
data =
|
data =
|
||||||
note.data
|
note_object.data
|
||||||
|> put_in(["object", "content"], nil)
|
|> Map.put("content", nil)
|
||||||
|
|
||||||
note =
|
Object.change(note_object, %{data: data})
|
||||||
note
|
|> Repo.update()
|
||||||
|> Map.put(:data, data)
|
|
||||||
|
|
||||||
user = User.get_cached_by_ap_id(note.data["actor"])
|
user = User.get_cached_by_ap_id(note.data["actor"])
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue