Skip to content

Speakr is a personal, self-hosted web application designed for transcribing audio recordings

Python

Video retention test follows the served content type (#438)

Murtaza Nasir248884db1604
diff --git a/tests/test_video_retention.py b/tests/test_video_retention.py
index 3056a245..5287ee11 100644
--- a/tests/test_video_retention.py
+++ b/tests/test_video_retention.py
@@ -260,20 +260,20 @@ class TestSendFileConditional(unittest.TestCase):
def test_recordings_streaming_has_conditional(self):
"""Streaming send_file in recordings.py has conditional=True."""
content = self._read_file('src/api/recordings.py')
- self.assertIn('return send_file(delivery.local_path, mimetype=recording.mime_type, conditional=True)', content)
+ self.assertIn('send_file(delivery.local_path, mimetype=serve_mime, conditional=True)', content)
def test_recordings_download_has_conditional(self):
"""Download send_file in recordings.py has conditional=True."""
content = self._read_file('src/api/recordings.py')
self.assertIn('as_attachment=True,', content)
self.assertIn('download_name=download_name,', content)
- self.assertIn('mimetype=recording.mime_type,', content)
+ self.assertIn('mimetype=serve_mime,', content)
self.assertIn('conditional=True,', content)
def test_shares_has_conditional(self):
"""send_file in shares.py has conditional=True."""
content = self._read_file('src/api/shares.py')
- self.assertIn('send_file(delivery.local_path, mimetype=(recording.mime_type or delivery.mimetype), conditional=True)', content)
+ self.assertIn('send_file(delivery.local_path, mimetype=serve_mime, conditional=True)', content)
class TestFrontendTemplates(unittest.TestCase):