mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-14 11:21:13 +00:00
Fix tests for profile redirect and add to notes
This commit is contained in:
parent
1e76430f74
commit
dd532e4425
3 changed files with 6 additions and 3 deletions
|
@ -20,6 +20,9 @@ Minor changes also include:
|
||||||
* Followers-only mode now works correctly inbound and outbound (though outbound
|
* Followers-only mode now works correctly inbound and outbound (though outbound
|
||||||
may need the other server to refresh the profile first).
|
may need the other server to refresh the profile first).
|
||||||
|
|
||||||
|
* Profile pages are no longer shown for remote identities; instead, users are
|
||||||
|
linked or redirected directly to the remote profile page.
|
||||||
|
|
||||||
If you'd like to help with code, design, or other areas, see
|
If you'd like to help with code, design, or other areas, see
|
||||||
:doc:`/contributing` to see how to get in touch.
|
:doc:`/contributing` to see how to get in touch.
|
||||||
|
|
||||||
|
|
|
@ -180,7 +180,7 @@ def test_linkify_mentions_local(config_system, identity, identity2, remote_ident
|
||||||
post.mentions.add(remote_identity)
|
post.mentions.add(remote_identity)
|
||||||
assert (
|
assert (
|
||||||
post.safe_content_local()
|
post.safe_content_local()
|
||||||
== '<p>Hello <span class="h-card"><a href="/@test@remote.test/" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>test</span></a></span></p>'
|
== '<p>Hello <span class="h-card"><a href="https://remote.test/@test/" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>test</span></a></span></p>'
|
||||||
)
|
)
|
||||||
# Test a full username (local)
|
# Test a full username (local)
|
||||||
post = Post.objects.create(
|
post = Post.objects.create(
|
||||||
|
@ -204,7 +204,7 @@ def test_linkify_mentions_local(config_system, identity, identity2, remote_ident
|
||||||
post.mentions.add(remote_identity)
|
post.mentions.add(remote_identity)
|
||||||
assert (
|
assert (
|
||||||
post.safe_content_local()
|
post.safe_content_local()
|
||||||
== '<span class="h-card"><a href="/@test@remote.test/" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>test</span></a></span> hello!'
|
== '<span class="h-card"><a href="https://remote.test/@test/" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>test</span></a></span> hello!'
|
||||||
)
|
)
|
||||||
# Test that they don't get touched without a mention
|
# Test that they don't get touched without a mention
|
||||||
post = Post.objects.create(
|
post = Post.objects.create(
|
||||||
|
|
|
@ -138,6 +138,6 @@ def test_parser_same_name_mentions(remote_identity, remote_identity2):
|
||||||
)
|
)
|
||||||
assert (
|
assert (
|
||||||
parser.html
|
parser.html
|
||||||
== '<span class="h-card"><a href="/@test@remote.test/" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>test</span></a></span> <span class="h-card"><a href="/@test@remote2.test/" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>test</span></a></span>'
|
== '<span class="h-card"><a href="https://remote.test/@test/" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>test</span></a></span> <span class="h-card"><a href="https://remote2.test/@test/" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>test</span></a></span>'
|
||||||
)
|
)
|
||||||
assert parser.plain_text == "@test @test"
|
assert parser.plain_text == "@test @test"
|
||||||
|
|
Loading…
Reference in a new issue