-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
activitypub: move postprocess_as2_actor out of postprocess_as2
...and into ActivityPub.convert and actor handler directly. for #690
- Loading branch information
Showing
3 changed files
with
39 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,12 @@ | |
from .testutil import Fake, TestCase | ||
|
||
import activitypub | ||
from activitypub import ActivityPub, default_signature_user, postprocess_as2 | ||
from activitypub import ( | ||
ActivityPub, | ||
default_signature_user, | ||
postprocess_as2, | ||
postprocess_as2_actor, | ||
) | ||
from atproto import ATProto | ||
import common | ||
from models import Follower, Object | ||
|
@@ -1773,9 +1778,9 @@ def test_postprocess_as2_hashtag(self): | |
], | ||
})) | ||
|
||
def test_postprocess_as2_url_attachments(self): | ||
def test_postprocess_as2_actor_url_attachments(self): | ||
g.user = self.user | ||
got = postprocess_as2(as2.from_as1({ | ||
got = postprocess_as2_actor(as2.from_as1({ | ||
'objectType': 'person', | ||
'urls': [ | ||
{ | ||
|
@@ -1813,12 +1818,12 @@ def test_postprocess_as2_url_attachments(self): | |
'value': '<a rel="me" href="https://two"><span class="invisible">https://</span>two</a>', | ||
}], got['attachment']) | ||
|
||
def test_postprocess_as2_preserves_preferredUsername(self): | ||
def test_postprocess_as2_actor_preserves_preferredUsername(self): | ||
# preferredUsername stays y.z despite user's username. since Mastodon | ||
# queries Webfinger for [email protected] | ||
# https://github.com/snarfed/bridgy-fed/issues/77#issuecomment-949955109 | ||
g.user = self.user | ||
self.assertEqual('user.com', postprocess_as2({ | ||
self.assertEqual('user.com', postprocess_as2_actor({ | ||
'type': 'Person', | ||
'url': 'https://user.com/about-me', | ||
'preferredUsername': 'nick', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters