def test_sources_unknown_type(self): fake_file = ContentFile(b("A boring example movie")) fake_file.name = 'movie' media = Media() media.file = File(fake_file) self.assertEqual(media.sources, [{ 'src': '/media/movie', 'type': 'application/octet-stream', }])
def test_sources_mp4_type(self): fake_file = ContentFile(b("A boring example movie")) fake_file.name = 'movie.mp4' media = Media() media.file = File(fake_file) self.assertEqual(media.sources, [{ 'src': '/media/movie.mp4', 'type': 'video/mp4', }])
def test_sources_unknown_type(self): fake_file = ContentFile(b("A boring example movie")) fake_file.name = "movie" media = Media() media.file = File(fake_file) self.assertEqual( media.sources, [{ "src": "/media/movie", "type": "application/octet-stream", }], )
def test_sources_mp4_type(self): fake_file = ContentFile(b("A boring example movie")) fake_file.name = "movie.mp4" media = Media() media.file = File(fake_file) self.assertEqual( media.sources, [{ "src": "/media/movie.mp4", "type": "video/mp4", }], )