def test_get_content_type_returns_correct_content_type(self): sut = MultipartSignedRequestFactory(None, None, None, None) self.assertEqual("Content-Type: image/jpeg", sut.get_content_type("img.jpeg")) self.assertEqual("Content-Type: image/jpeg", sut.get_content_type("img.jpg")) self.assertEqual("Content-Type: application/pdf", sut.get_content_type("doc.pdf")) self.assertEqual("Content-Type: application/msword", sut.get_content_type("doc.doc")) self.assertEqual("Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document", sut.get_content_type("doc.docx"))
def test_get_content_type_returns_correct_content_type(self): sut = MultipartSignedRequestFactory(None, None, None, None) self.assertEqual("Content-Type: image/jpeg".encode(), sut.get_content_type("img.jpeg")) self.assertEqual("Content-Type: image/jpeg".encode(), sut.get_content_type("img.jpg")) self.assertEqual("Content-Type: application/pdf".encode(), sut.get_content_type("doc.pdf")) self.assertEqual("Content-Type: application/msword".encode(), sut.get_content_type("doc.doc")) self.assertEqual( "Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document".encode(), sut.get_content_type("doc.docx"))