Post to mastodon from the profile page for logged in users

This commit is contained in:
2026-08-26 10:20:48 +02:00
parent 9deb28330a
commit 95accdf436
13 changed files with 136 additions and 5 deletions
+3
View File
@@ -403,6 +403,7 @@ def test_public_and_admin_pages_render_html():
feed_script = client.get('/static/feed.js?v=7').text
assert 'if (item.is_owner && !showIdentity)' in feed_script
assert 'deleteEntry(item, deleteButton)' in feed_script
assert 'postToMastodon(item, mastodonButton)' in feed_script
assert 'tag.toLowerCase() === pref.tag.toLowerCase()' in feed_script
assert 'return `${date.getFullYear()} ${months[date.getMonth()]} ${date.getDate()} - ${hours}:${minutes}`' in feed_script
assert 'edit-tag-options' in feed_script
@@ -452,6 +453,8 @@ def test_link_submission_posts_to_enabled_mastodon_plugin():
assert received['authorization'] == 'Bearer test-token'
assert received['content_type'] == 'application/x-www-form-urlencoded'
assert received['body'] == {'status': ['From my #LinkLog: A useful page\n\nWorth sharing\n\nfrom: https://example.com/useful\n\n#python #web']}
posted_item = next(item for item in client.get('/api/public/feed/alice', headers=headers).json() if item['id'] == response.json()['id'])
assert posted_item['mastodon_posted'] is True
finally:
server.shutdown()
thread.join()