'Test that a user can upload raw content with the appropriate mimetype'

@ddt.data(('image/jpeg', '.jpg'), ('image/jpeg', '.jpeg'), ('image/pjpeg', '.jpg'), ('image/pjpeg', '.jpeg'), ('image/png', '.png'), ('image/gif', '.gif'), ('image/gif', '.GIF'))
@ddt.unpack
@patch('openedx.core.djangoapps.profile_images.views._make_upload_dt', return_value=TEST_UPLOAD_DT)
def test_upload_by_mimetype(self, content_type, extension, _mock_make_image_version, mock_log):

    with make_image_file(extension=extension) as image_file:
        data = image_file.read()
        response = self.client.post(self.url, data, content_type=content_type, HTTP_CONTENT_DISPOSITION='attachment;filename=filename{}'.format(extension))
        self.check_response(response, 204)
        self.check_images()
        self.check_has_profile_image()
    mock_log.info.assert_called_once_with(LOG_MESSAGE_CREATE, {'image_names': get_profile_image_names(self.user.username).values(), 'user_id': self.user.id})
    self.check_upload_event_emitted()
