Use dataclasses to define activitypub (de)serialization (#177)
* Use dataclasses to define activitypub (de)serialization
This commit is contained in:
parent
2c0a07a330
commit
8bbf1fe252
46 changed files with 1449 additions and 1228 deletions
|
@ -10,12 +10,17 @@ from django.test import TestCase, Client
|
|||
from django.utils.http import http_date
|
||||
|
||||
from fedireads.models import User
|
||||
from fedireads.activitypub import get_follow_request
|
||||
from fedireads.activitypub import Follow
|
||||
from fedireads.settings import DOMAIN
|
||||
from fedireads.signatures import create_key_pair, make_signature, make_digest
|
||||
|
||||
def get_follow_data(follower, followee):
|
||||
return json.dumps(get_follow_request(follower, followee)).encode('utf-8')
|
||||
follow_activity = Follow(
|
||||
id='https://test.com/user/follow/id',
|
||||
actor=follower.remote_id,
|
||||
object=followee.remote_id,
|
||||
).serialize()
|
||||
return json.dumps(follow_activity)
|
||||
|
||||
Sender = namedtuple('Sender', ('remote_id', 'private_key', 'public_key'))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue