def test_serve_static_file_serves_mp3(self): request = HttpRequest() file_path = self.audio.local_path_mp3 response = serve_static_file(request, file_path=self.good_mp3_path) self.assertEqual(response.status_code, 200) self.assertEqual(response['Content-Type'], 'audio/mpeg') self.assertIn('inline;', response['Content-Disposition'])
def test_serve_static_file_serves_txt(self): request = HttpRequest() response = serve_static_file(request, file_path=self.good_txt_path) self.assertEqual(response.status_code, 200) self.assertEqual(response["Content-Type"], "text/plain") self.assertIn("inline;", response["Content-Disposition"]) self.assertIn("FOR THE DISTRICT OF COLUMBIA CIRCUIT", response.content)
def test_serve_static_file_serves_txt(self): request = HttpRequest() response = serve_static_file(request, file_path=self.good_txt_path) self.assertEqual(response.status_code, 200) self.assertEqual(response['Content-Type'], 'text/plain') self.assertIn('attachment;', response['Content-Disposition']) self.assertIn('FOR THE DISTRICT OF COLUMBIA CIRCUIT', response.content)
def test_serve_static_file_serves_mp3(self): request = HttpRequest() file_path = self.audio.local_path_mp3 response = serve_static_file(request, file_path=self.good_mp3_path) self.assertEqual(response.status_code, 200) self.assertEqual(response["Content-Type"], "audio/mpeg") self.assertIn("inline;", response["Content-Disposition"])
def test_serve_static_file_serves_txt(self): request = HttpRequest() response = serve_static_file(request, file_path=self.good_txt_path) self.assertEqual(response.status_code, 200) self.assertEqual(response['Content-Type'], 'text/plain') self.assertIn('inline;', response['Content-Disposition']) self.assertIn( 'FOR THE DISTRICT OF COLUMBIA CIRCUIT', response.content )
def test_serve_static_file_serves_pdf(self): request = HttpRequest() response = serve_static_file(request, file_path=self.good_pdf_path) self.assertEqual(response.status_code, 200) self.assertEqual(response['Content-Type'], 'application/pdf') self.assertIn('inline;', response['Content-Disposition'])
def test_serve_static_file_serves_pdf(self): request = HttpRequest() response = serve_static_file(request, file_path=self.good_pdf_path) self.assertEqual(response.status_code, 200) self.assertEqual(response["Content-Type"], "application/pdf") self.assertIn("inline;", response["Content-Disposition"])