Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zwordi
funkwhale
Commits
feab0f98
Verified
Commit
feab0f98
authored
6 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Spaces > Tabs
parent
363acca5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/tests/federation/test_serializers.py
+44
-44
44 additions, 44 deletions
api/tests/federation/test_serializers.py
with
44 additions
and
44 deletions
api/tests/federation/test_serializers.py
+
44
−
44
View file @
feab0f98
...
...
@@ -7,25 +7,25 @@ from funkwhale_api.federation import serializers
def
test_actor_serializer_from_ap
(
db
):
payload
=
{
'
id
'
:
'
https://test.federation/user
'
,
'
type
'
:
'
Person
'
,
'
following
'
:
'
https://test.federation/user/following
'
,
'
followers
'
:
'
https://test.federation/user/followers
'
,
'
inbox
'
:
'
https://test.federation/user/inbox
'
,
'
outbox
'
:
'
https://test.federation/user/outbox
'
,
'
preferredUsername
'
:
'
user
'
,
'
name
'
:
'
Real User
'
,
'
summary
'
:
'
Hello world
'
,
'
url
'
:
'
https://test.federation/@user
'
,
'
manuallyApprovesFollowers
'
:
False
,
'
publicKey
'
:
{
'
id
'
:
'
https://test.federation/user#main-key
'
,
'
owner
'
:
'
https://test.federation/user
'
,
'
publicKeyPem
'
:
'
yolo
'
},
'
endpoints
'
:
{
'
sharedInbox
'
:
'
https://test.federation/inbox
'
},
'
id
'
:
'
https://test.federation/user
'
,
'
type
'
:
'
Person
'
,
'
following
'
:
'
https://test.federation/user/following
'
,
'
followers
'
:
'
https://test.federation/user/followers
'
,
'
inbox
'
:
'
https://test.federation/user/inbox
'
,
'
outbox
'
:
'
https://test.federation/user/outbox
'
,
'
preferredUsername
'
:
'
user
'
,
'
name
'
:
'
Real User
'
,
'
summary
'
:
'
Hello world
'
,
'
url
'
:
'
https://test.federation/@user
'
,
'
manuallyApprovesFollowers
'
:
False
,
'
publicKey
'
:
{
'
id
'
:
'
https://test.federation/user#main-key
'
,
'
owner
'
:
'
https://test.federation/user
'
,
'
publicKeyPem
'
:
'
yolo
'
},
'
endpoints
'
:
{
'
sharedInbox
'
:
'
https://test.federation/inbox
'
},
}
serializer
=
serializers
.
ActorSerializer
(
data
=
payload
)
...
...
@@ -50,13 +50,13 @@ def test_actor_serializer_from_ap(db):
def
test_actor_serializer_only_mandatory_field_from_ap
(
db
):
payload
=
{
'
id
'
:
'
https://test.federation/user
'
,
'
type
'
:
'
Person
'
,
'
following
'
:
'
https://test.federation/user/following
'
,
'
followers
'
:
'
https://test.federation/user/followers
'
,
'
inbox
'
:
'
https://test.federation/user/inbox
'
,
'
outbox
'
:
'
https://test.federation/user/outbox
'
,
'
preferredUsername
'
:
'
user
'
,
'
id
'
:
'
https://test.federation/user
'
,
'
type
'
:
'
Person
'
,
'
following
'
:
'
https://test.federation/user/following
'
,
'
followers
'
:
'
https://test.federation/user/followers
'
,
'
inbox
'
:
'
https://test.federation/user/inbox
'
,
'
outbox
'
:
'
https://test.federation/user/outbox
'
,
'
preferredUsername
'
:
'
user
'
,
}
serializer
=
serializers
.
ActorSerializer
(
data
=
payload
)
...
...
@@ -82,24 +82,24 @@ def test_actor_serializer_to_ap():
'
https://w3id.org/security/v1
'
,
{},
],
'
id
'
:
'
https://test.federation/user
'
,
'
type
'
:
'
Person
'
,
'
following
'
:
'
https://test.federation/user/following
'
,
'
followers
'
:
'
https://test.federation/user/followers
'
,
'
inbox
'
:
'
https://test.federation/user/inbox
'
,
'
outbox
'
:
'
https://test.federation/user/outbox
'
,
'
preferredUsername
'
:
'
user
'
,
'
name
'
:
'
Real User
'
,
'
summary
'
:
'
Hello world
'
,
'
manuallyApprovesFollowers
'
:
False
,
'
publicKey
'
:
{
'
id
'
:
'
https://test.federation/user#main-key
'
,
'
owner
'
:
'
https://test.federation/user
'
,
'
publicKeyPem
'
:
'
yolo
'
},
'
endpoints
'
:
{
'
sharedInbox
'
:
'
https://test.federation/inbox
'
},
'
id
'
:
'
https://test.federation/user
'
,
'
type
'
:
'
Person
'
,
'
following
'
:
'
https://test.federation/user/following
'
,
'
followers
'
:
'
https://test.federation/user/followers
'
,
'
inbox
'
:
'
https://test.federation/user/inbox
'
,
'
outbox
'
:
'
https://test.federation/user/outbox
'
,
'
preferredUsername
'
:
'
user
'
,
'
name
'
:
'
Real User
'
,
'
summary
'
:
'
Hello world
'
,
'
manuallyApprovesFollowers
'
:
False
,
'
publicKey
'
:
{
'
id
'
:
'
https://test.federation/user#main-key
'
,
'
owner
'
:
'
https://test.federation/user
'
,
'
publicKeyPem
'
:
'
yolo
'
},
'
endpoints
'
:
{
'
sharedInbox
'
:
'
https://test.federation/inbox
'
},
}
ac
=
models
.
Actor
(
url
=
expected
[
'
id
'
],
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment