From: Chris Fulljames Date: Sat, 22 Mar 2025 15:45:29 +0000 (-0400) Subject: Add tests for profile and playlist comments X-Git-Url: https://littlesong.place/gitweb/?a=commitdiff_plain;h=9ced4f3a71d8787452b3e5d3faf5a376d834078a;p=littlesongplace.git Add tests for profile and playlist comments --- diff --git a/test/test_offline.py b/test/test_offline.py index 78815e3..1a2d54f 100644 --- a/test/test_offline.py +++ b/test/test_offline.py @@ -709,6 +709,20 @@ def test_reply_to_comment(client): assert b"parent comment" in response.data assert b"child comment" in response.data +def test_comment_on_profile(client): + _create_user(client, "user1", login=True) + response = client.get("/comment?threadid=1", headers={"Referer": "/users/user1"}) + response = client.post("/comment?threadid=1", data={"content": "comment on profile"}, follow_redirects=True) + assert response.request.path == "/users/user1" + assert b"comment on profile" in response.data + +def test_comment_on_playlist(client): + _create_user_song_and_playlist(client) + response = client.get("/comment?threadid=3", headers={"Referer": "/playlists/1"}) + response = client.post("/comment?threadid=3", data={"content": "comment on playlist"}, follow_redirects=True) + assert response.request.path == "/playlists/1" + assert b"comment on playlist" in response.data + ################################################################################ # Comments - Auth Status and Errors ################################################################################