From 8351e6983c2b506f6be01ed2150470cdd1b32e71 Mon Sep 17 00:00:00 2001 From: Bastiaan Welmers Date: Wed, 6 Apr 2022 20:09:59 +0200 Subject: [PATCH] Add view test for correct transcoding order --- tests/videodinges/views/test_video.py | 46 +++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/tests/videodinges/views/test_video.py b/tests/videodinges/views/test_video.py index 253a834..50478d5 100644 --- a/tests/videodinges/views/test_video.py +++ b/tests/videodinges/views/test_video.py @@ -245,6 +245,52 @@ class VideoTestCase(UploadMixin, TestCase): content, ) + def test_video_view_renders_transcoding_types_in_correct_order(self): + + video = factories.create( + models.Video, + title='Vid 1', + slug='vid-1', + default_quality='480p', + ) + factories.create( + models.Transcoding, + video=video, + quality='480p', + type='video/mp4; codecs="avc1.64001e,mp4a.40.2"', + url='http://480p.mp4', + ) + factories.create( + models.Transcoding, + video=video, + quality='480p', + type='video/webm; codecs="vp9, opus"', + url='http://480p.vp9.webm', + ) + factories.create( + models.Transcoding, + video=video, + quality='480p', + type='video/webm; codecs="vp8, vorbis"', + url='http://480p.vp8.webm', + ) + + resp:HttpResponse = self.client.get(reverse('video', args=['vid-1'])) + + self.assertEqual(resp.status_code, 200) + + content:str = resp.content.decode(resp.charset) + + self.assertInHTML( + """""", + content, + ) + class VideoWithTrackTestCase(UploadMixin, TestCase): def setUp(self):