Exemple #1
0
 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',
     }])
Exemple #2
0
 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',
     }])
Exemple #3
0
 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",
         }],
     )
Exemple #4
0
 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",
         }],
     )