Skip to content

Commit

Permalink
Fix tests for profile redirect and add to notes
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgodwin committed Sep 8, 2023
1 parent 1e76430 commit dd532e4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions docs/releases/0.10.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ Minor changes also include:
* Followers-only mode now works correctly inbound and outbound (though outbound
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
:doc:`/contributing` to see how to get in touch.

Expand Down
4 changes: 2 additions & 2 deletions tests/activities/models/test_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def test_linkify_mentions_local(config_system, identity, identity2, remote_ident
post.mentions.add(remote_identity)
assert (
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)
post = Post.objects.create(
Expand All @@ -204,7 +204,7 @@ def test_linkify_mentions_local(config_system, identity, identity2, remote_ident
post.mentions.add(remote_identity)
assert (
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
post = Post.objects.create(
Expand Down
2 changes: 1 addition & 1 deletion tests/core/test_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,6 @@ def test_parser_same_name_mentions(remote_identity, remote_identity2):
)
assert (
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"

0 comments on commit dd532e4

Please sign in to comment.