fix: count opted-out likes and reposts without naming them (v2.13.3)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
76b81d6ad9
commit
113f28aff1
9 files changed
+85
-9
No files matched your search
@@ -604,3 +604,21 @@ def test_own_gotosocial_redirect_to_remote_avatar_is_followed(app, web, monkeypa
|
||||
monkeypatch.setattr("starpunk.webmention_ssrf.TRANSPORT", httpx.MockTransport(fake))
|
||||
with app.app_context():
|
||||
assert avatars.fetch(app.config["DATA_PATH"], f"{GTS}/fileserver/x/avatar.jpeg", SITE)
|
||||
|
||||
|
||||
def test_people_who_opt_out_are_counted_not_named(app, client):
|
||||
"""v2.13.3: likes and reposts by people who opted out add to the totals anonymously"""
|
||||
note, sid = crossposted(app)
|
||||
shy = like(5, opted_out=True)
|
||||
client.harvest = Harvest([like(1), shy, like(6, bio="#nobot"),
|
||||
Response(kind="repost", source_url=f"{COPY}#reposted-by-7", remote_id="7",
|
||||
author_name="Quiet", author_bio="#nobridge")])
|
||||
run(app)
|
||||
with app.app_context():
|
||||
s = get_db(app).execute("SELECT likes_count, reposts_count FROM syndications WHERE id = ?",
|
||||
(sid,)).fetchone()
|
||||
assert (s["likes_count"], s["reposts_count"]) == (2, 1)
|
||||
assert [r["source_url"] for r in rows(app, note.id)] == [like(1).source_url]
|
||||
page = app.test_client().get(f"/note/{note.slug}").get_data(as_text=True)
|
||||
assert '<span class="reaction-count">3</span>' in page and "+2 on GoToSocial" in page
|
||||
assert "Liker 5" not in page and "Quiet" not in page
|
||||
Reference in new issue
Block a user