Post to mastodon from the profile page for logged in users
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -10,7 +10,7 @@ def test_database_migrations_are_versioned_and_idempotent():
|
||||
connection = sqlite3.connect(':memory:')
|
||||
|
||||
apply_migrations(connection)
|
||||
assert get_schema_version(connection) == 8
|
||||
assert get_schema_version(connection) == 9
|
||||
tables = {
|
||||
row[0]
|
||||
for row in connection.execute(
|
||||
@@ -27,6 +27,6 @@ def test_database_migrations_are_versioned_and_idempotent():
|
||||
assert set(DEFAULT_TAGS) <= seeded_tags
|
||||
|
||||
apply_migrations(connection)
|
||||
assert get_schema_version(connection) == 8
|
||||
assert get_schema_version(connection) == 9
|
||||
|
||||
connection.close()
|
||||
Reference in New Issue
Block a user