diff options
author | Andrew Godwin | 2022-12-05 20:26:21 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-12-05 20:26:21 -0700 |
commit | 5b82c76defd8016df137087e5ce55b44cf017399 (patch) | |
tree | ff96b3a84622219130ec0d46a1b52566b3d6b3c6 /tests/activities | |
parent | 9fe2e6676c32b93023ae301be587a8ab0d93120f (diff) | |
download | takahe-5b82c76defd8016df137087e5ce55b44cf017399.tar.gz takahe-5b82c76defd8016df137087e5ce55b44cf017399.tar.bz2 takahe-5b82c76defd8016df137087e5ce55b44cf017399.zip |
Shorten mention names when linkified
Fixes #121
Diffstat (limited to 'tests/activities')
-rw-r--r-- | tests/activities/models/test_post.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/activities/models/test_post.py b/tests/activities/models/test_post.py index 00db61b..06d26ed 100644 --- a/tests/activities/models/test_post.py +++ b/tests/activities/models/test_post.py @@ -56,7 +56,7 @@ def test_linkify_mentions_remote(identity, remote_identity): post.mentions.add(identity) assert ( post.safe_content_remote() - == '<p><a href="https://example.com/@test/">@test@example.com</a>, welcome!</p>' + == '<p><a href="https://example.com/@test/">@test</a>, welcome!</p>' ) # Test that they don't get touched without a mention post = Post.objects.create( @@ -103,7 +103,7 @@ def test_linkify_mentions_local(identity, remote_identity): post.mentions.add(identity) assert ( post.safe_content_local() - == '<p><a href="/@test@example.com/">@test@example.com</a>, welcome!</p>' + == '<p><a href="/@test@example.com/">@test</a>, welcome!</p>' ) # Test a full username (remote) with no <p> post = Post.objects.create( @@ -112,10 +112,7 @@ def test_linkify_mentions_local(identity, remote_identity): local=True, ) post.mentions.add(remote_identity) - assert ( - post.safe_content_local() - == '<a href="/@test@remote.test/">@test@remote.test</a> hello!' - ) + assert post.safe_content_local() == '<a href="/@test@remote.test/">@test</a> hello!' # Test that they don't get touched without a mention post = Post.objects.create( content="<p>@test@example.com, welcome!</p>", |