'Test that TypedFileUploadParser raises an exception when the specified
content-type doesn\'t match the filename extension in the
content-disposition header.'

def test_parse_mismatched_filename_and_mimetype(self):

    request = self.request_factory.post('/', content_type='image/png', HTTP_CONTENT_DISPOSITION='attachment;    filename="file.jpg"')
    context = {'view': self.view, 'request': request}
    with self.assertRaises(exceptions.ParseError) as err:
        self.parser.parse(stream=BytesIO('abcdefgh'), media_type='image/png', parser_context=context)
        self.assertIn('developer_message', err.detail)
        self.assertNotIn('user_message', err.detail)
