Add a pyfed context to all AP payloads

merge-requests/156/head
Jason Robinson 2019-08-18 04:42:14 +03:00
rodzic 564f917f7a
commit 5045127072
2 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -2,10 +2,12 @@ CONTEXT_ACTIVITYSTREAMS = "https://www.w3.org/ns/activitystreams"
CONTEXT_HASHTAG = {"Hashtag": "as:Hashtag"}
CONTEXT_LD_SIGNATURES = "https://w3id.org/security/v1"
CONTEXT_MANUALLY_APPROVES_FOLLOWERS = {"manuallyApprovesFollowers": "as:manuallyApprovesFollowers"}
CONTEXT_PYTHON_FEDERATION = {"pyfed": "https://jasonrobinson.me/ns/federation"}
CONTEXT_SENSITIVE = {"sensitive": "as:sensitive"}
CONTEXTS_DEFAULT = [
CONTEXT_ACTIVITYSTREAMS,
CONTEXT_PYTHON_FEDERATION,
]
NAMESPACE_PUBLIC = "https://www.w3.org/ns/activitystreams#Public"

Wyświetl plik

@ -42,6 +42,7 @@ class TestEntitiesConvertToAS2:
assert result == {
'@context': [
'https://www.w3.org/ns/activitystreams',
{"pyfed": "https://jasonrobinson.me/ns/federation"},
{'Hashtag': 'as:Hashtag'},
'https://w3id.org/security/v1',
{'sensitive': 'as:sensitive'},
@ -99,6 +100,7 @@ class TestEntitiesConvertToAS2:
assert result == {
'@context': [
'https://www.w3.org/ns/activitystreams',
{"pyfed": "https://jasonrobinson.me/ns/federation"},
{'Hashtag': 'as:Hashtag'},
'https://w3id.org/security/v1',
{'sensitive': 'as:sensitive'},
@ -131,6 +133,7 @@ class TestEntitiesConvertToAS2:
assert result == {
'@context': [
'https://www.w3.org/ns/activitystreams',
{"pyfed": "https://jasonrobinson.me/ns/federation"},
{'Hashtag': 'as:Hashtag'},
'https://w3id.org/security/v1',
{'sensitive': 'as:sensitive'},
@ -209,6 +212,7 @@ class TestEntitiesConvertToAS2:
assert result == {
'@context': [
'https://www.w3.org/ns/activitystreams',
{"pyfed": "https://jasonrobinson.me/ns/federation"},
],
'type': 'Delete',
'id': 'http://127.0.0.1:8000/post/123456/#delete',
@ -225,6 +229,7 @@ class TestEntitiesConvertToAS2:
assert result == {
'@context': [
'https://www.w3.org/ns/activitystreams',
{"pyfed": "https://jasonrobinson.me/ns/federation"},
],
'type': 'Undo',
'id': 'http://127.0.0.1:8000/post/123456/#delete',