Skip to content

Commit

Permalink
Adequacao test_favorite.py
Browse files Browse the repository at this point in the history
  • Loading branch information
viniman27 authored Aug 9, 2024
1 parent f4e58ad commit 4e65ab1
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions tests/test_favorite.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,23 +76,5 @@ def test_remove_from_favorites():
assert response.status_code == 200
assert response.json()["statusfavorite"] is False

def test_get_favorite_videos():
user_id = str(uuid.uuid4())

# Add multiple videos to the favorite list
video_ids = [str(uuid.uuid4()) for _ in range(3)]
for video_id in video_ids:
client.post("/api/favorite/", json={"user_id": user_id, "video_id": video_id})

# Retrieve the favorite list
response = client.get(f"/api/favorite/?user_id={user_id}")
assert response.status_code == 200
assert "videoList" in response.json()
video_list = response.json()["videoList"]

# Check if the specific video is in the favorite list
retrieved_video_ids = [item["video_id"] for item in video_list]
for video_id in video_ids:
assert video_id in retrieved_video_ids


0 comments on commit 4e65ab1

Please sign in to comment.