Prefetch some notes when following an actor
This commit is contained in:
parent
c711096262
commit
59af633c6c
4 changed files with 63 additions and 3 deletions
|
@ -7,6 +7,7 @@ import fastapi
|
|||
import httpx
|
||||
import respx
|
||||
|
||||
from app import activitypub as ap
|
||||
from app import actor
|
||||
from app import httpsig
|
||||
from app import models
|
||||
|
@ -45,6 +46,18 @@ def setup_remote_actor(respx_mock: respx.MockRouter) -> actor.RemoteActor:
|
|||
username="toto",
|
||||
public_key="pk",
|
||||
)
|
||||
respx_mock.get(ra.ap_id + "/outbox").mock(
|
||||
return_value=httpx.Response(
|
||||
200,
|
||||
json={
|
||||
"@context": ap.AS_EXTENDED_CTX,
|
||||
"id": f"{ra.ap_id}/outbox",
|
||||
"type": "OrderedCollection",
|
||||
"totalItems": 0,
|
||||
"orderedItems": [],
|
||||
},
|
||||
)
|
||||
)
|
||||
respx_mock.get(ra.ap_id).mock(return_value=httpx.Response(200, json=ra.ap_actor))
|
||||
return ra
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue