]> littlesong.place Git - littlesongplace.git/commitdiff
Add tests for profile and playlist comments
authorChris Fulljames <christianfulljames@gmail.com>
Sat, 22 Mar 2025 15:45:29 +0000 (11:45 -0400)
committerChris Fulljames <christianfulljames@gmail.com>
Sat, 22 Mar 2025 15:45:29 +0000 (11:45 -0400)
test/test_offline.py

index 78815e3715fea99a10721e493e65f4ba46d80616..1a2d54ffe31ee54f50f2f9a61f251044984759c9 100644 (file)
@@ -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
 ################################################################################