ticket #85 attempt 1

This commit is contained in:
Typosaurus
2026-07-23 01:19:19 +00:00
parent ad1736ebf1
commit 1d1efc0dfc
4 changed files with 50 additions and 2 deletions
+20
View File
@@ -166,3 +166,23 @@ def test_send_attachment_only_empty_content_succeeds(seeded_db):
refresh_snapshot()
row = get_table("messages").find_one(uid=msg["uid"])
assert row["content"] == ""
def test_duplicate_message_returns_same_uid(seeded_db):
s, _ = _member()
receiver = _db_user("bob_test")["uid"]
content = _unique("dupmsg")
first = s.post(
f"{BASE_URL}/messages/send",
headers=JSON_audit_log,
data={"content": content, "receiver_uid": receiver},
).json()["data"]
second = s.post(
f"{BASE_URL}/messages/send",
headers=JSON_audit_log,
data={"content": content, "receiver_uid": receiver},
).json()["data"]
assert first["uid"] == second["uid"], "duplicate messages should return the same uid"