예제 #1
0
 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'])
예제 #2
0
 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)
예제 #3
0
 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)
예제 #4
0
 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"])
예제 #5
0
 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'])
예제 #6
0
 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
     )
예제 #7
0
 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'])
예제 #8
0
 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"])
예제 #9
0
 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'])