-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
User.enable_protocol: fill in real welcome DM message
- Loading branch information
Showing
2 changed files
with
28 additions
and
6 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 |
---|---|---|
|
@@ -396,12 +396,13 @@ def test_activitypub_follow_bsky_bot_user_enables_protocol(self, mock_get, mock_ | |
# bot user DM | ||
args, kwargs = mock_post.call_args_list[1] | ||
self.assert_equals(('http://inst/inbox',), args) | ||
message = '<p>Welcome to Bridgy Fed! Your account will soon be bridged to Bluesky at <a href="https://bsky.app/profile/alice.inst.ap.brid.gy">alice.inst.ap.brid.gy</a>. <a href="https://fed.brid.gy/docs">See the docs</a> and <a href="https://fed.brid.gy/ap/@alice@inst">your user page</a> for more information. To disable this and delete your bridged profile, block this account.</p>' | ||
self.assert_equals({ | ||
'type': 'Note', | ||
'id': 'https://bsky.brid.gy/r/https://bsky.brid.gy/#welcome-dm-https://inst/alice-2022-01-02T03:04:05+00:00', | ||
'actor': 'https://bsky.brid.gy/bsky.brid.gy', | ||
'content': '<p>hello world</p>', | ||
'contentMap': {'en': '<p>hello world</p>'}, | ||
'content': message, | ||
'contentMap': {'en': message}, | ||
'content_is_html': True, | ||
'to': ['https://inst/alice'], | ||
}, json_loads(kwargs['data']), ignore=['to', '@context']) | ||
|
@@ -518,9 +519,24 @@ def test_atproto_follow_ap_bot_user_enables_protocol(self, mock_get, mock_post): | |
'convoId': 'convo123', | ||
'message': { | ||
'$type': 'chat.bsky.convo.defs#messageInput', | ||
'text': 'hello world', | ||
'text': 'Welcome to Bridgy Fed! Your account will soon be bridged to the fediverse at @[email protected]. See the docs and your user page for more information. To disable this and delete your bridged profile, block this account.', | ||
'facets': [{ | ||
'$type': 'app.bsky.richtext.facet', | ||
'index': {'byteStart': 102, 'byteEnd': 114}, | ||
'features': [{ | ||
'$type': 'app.bsky.richtext.facet#link', | ||
'uri': 'https://fed.brid.gy/docs', | ||
}], | ||
}, { | ||
'$type': 'app.bsky.richtext.facet', | ||
'index': {'byteStart': 119, 'byteEnd': 133}, | ||
'features': [{ | ||
'$type': 'app.bsky.richtext.facet#link', | ||
'uri': 'https://fed.brid.gy/bsky/alice.com', | ||
}], | ||
}], | ||
'createdAt': '2022-01-02T03:04:05.000Z', | ||
'bridgyOriginalText': 'hello world', | ||
'bridgyOriginalText': 'Welcome to Bridgy Fed! Your account will soon be bridged to the fediverse at @[email protected]. <a href="https://fed.brid.gy/docs">See the docs</a> and <a href="https://fed.brid.gy/bsky/alice.com">your user page</a> for more information. To disable this and delete your bridged profile, block this account.', | ||
'bridgyOriginalUrl': 'https://ap.brid.gy/#welcome-dm-did:plc:alice-2022-01-02T03:04:05+00:00', | ||
}, | ||
}, data=None, headers=headers) | ||
|