ticket #114 attempt 1

This commit is contained in:
Typosaurus
2026-07-23 03:15:14 +00:00
parent ad1736ebf1
commit 7332e4dd59
4 changed files with 14 additions and 4 deletions
+10
View File
@@ -135,3 +135,13 @@ def test_non_ajax_vote_redirects_to_referer(app_server):
)
assert r.status_code == 302
assert r.headers["location"] == "/gists"
def test_explicit_zero_retracts_vote(app_server):
s_a, a_name = _session_votes()
s_b, _ = _session_votes()
post_uid = _make_post_votes(_uid_votes(a_name))
s_b.post(f"{BASE_URL}/votes/post/{post_uid}", data={"value": "1"}, headers=AJAX_votes)
r = s_b.post(f"{BASE_URL}/votes/post/{post_uid}", data={"value": "0"}, headers=AJAX_votes)
assert r.json()["value"] == 0
assert r.json()["net"] == 0