]> littlesong.place Git - littlesongplace.git/commitdiff
Fix broken tests
authorChris Fulljames <christianfulljames@gmail.com>
Sun, 23 Feb 2025 15:02:14 +0000 (10:02 -0500)
committerChris Fulljames <christianfulljames@gmail.com>
Sun, 23 Feb 2025 15:02:14 +0000 (10:02 -0500)
test/test_offline.py

index 9d9389b664442364c02c69391a2bc90e47419f32..2260fb087b33c6fd94a8ead84926fe296aaeeae7 100644 (file)
@@ -235,7 +235,7 @@ def test_get_pfp_invalid_user(client):
 # Upload Song
 ################################################################################
 
-def _test_upload_song(client, msg, error=False, songid=None, user="user", filename="sample-3s.mp3", **kwargs):
+def _test_upload_song(client, msg, error=False, songid=None, user="user", userid=1, filename="sample-3s.mp3", **kwargs):
     song_file = open(filename, "rb")
 
     data = {
@@ -256,6 +256,8 @@ def _test_upload_song(client, msg, error=False, songid=None, user="user", filena
     assert response.status_code == 302
     if error:
         assert response.headers["Location"] == "None"
+    elif songid:
+        assert response.headers["Location"] == f"/song/{userid}/{songid}?action=view"
     else:
         assert response.headers["Location"] == f"/users/{user}"