@@ -22,10 +22,10 @@ def test_video_short_serializer_read():
2222 title = "Test Video" ,
2323 description = "Test description" ,
2424 published_at = datetime (2024 , 1 , 15 , 12 , 0 , 0 , tzinfo = UTC ),
25- thumbnail_url = "https://example.com/thumb .jpg" ,
25+ thumbnail_url = "/shorts/test_123/test_123 .jpg" ,
2626 thumbnail_height = 360 ,
2727 thumbnail_width = 480 ,
28- video_url = "https://example.com/video .mp4" ,
28+ video_url = "/shorts/test_123/test_123 .mp4" ,
2929 )
3030
3131 serializer = VideoShortSerializer (video_short )
@@ -41,10 +41,10 @@ def test_video_short_serializer_read():
4141 "title" : "Test Video" ,
4242 "description" : "Test description" ,
4343 "published_at" : "2024-01-15T12:00:00Z" ,
44- "thumbnail_url" : "https://example.com/thumb .jpg" ,
44+ "thumbnail_url" : "/shorts/test_123/test_123 .jpg" ,
4545 "thumbnail_height" : 360 ,
4646 "thumbnail_width" : 480 ,
47- "video_url" : "https://example.com/video .mp4" ,
47+ "video_url" : "/shorts/test_123/test_123 .mp4" ,
4848 },
4949 )
5050
@@ -56,10 +56,10 @@ def test_video_short_serializer_create():
5656 "title" : "Created Video" ,
5757 "description" : "Created description" ,
5858 "published_at" : "2024-01-15T12:00:00Z" ,
59- "thumbnail_url" : "https://example.com/created_thumb .jpg" ,
59+ "thumbnail_url" : "/shorts/create_test/create_test .jpg" ,
6060 "thumbnail_height" : 720 ,
6161 "thumbnail_width" : 1280 ,
62- "video_url" : "https://example.com/created_video .mp4" ,
62+ "video_url" : "/shorts/create_test/create_test .mp4" ,
6363 }
6464
6565 serializer = VideoShortSerializer (data = data )
@@ -120,9 +120,12 @@ def test_video_short_serializer_update():
120120 assert_json_equal (result_data , data )
121121
122122
123- def test_youtube_metadata_serializer (settings , sample_youtube_metadata ):
123+ @pytest .mark .parametrize (
124+ "prefix" , ["youtube_shorts/" , "youtube_shorts" , "youtube_shorts//" ]
125+ )
126+ def test_youtube_metadata_serializer (settings , sample_youtube_metadata , prefix ):
124127 """Test YouTubeMetadataSerializer transforms YouTube API data correctly"""
125- settings .VIDEO_SHORTS_S3_PREFIX = "youtube_shorts"
128+ settings .VIDEO_SHORTS_S3_PREFIX = prefix
126129
127130 serializer = YouTubeMetadataSerializer (data = sample_youtube_metadata )
128131 assert serializer .is_valid ()
0 commit comments