'Test that an authenticated user can POST to their own upload endpoint.'

@ddt.data('.jpg', '.jpeg', '.jpg', '.jpeg', '.png', '.gif', '.GIF')
@patch('openedx.core.djangoapps.profile_images.views._make_upload_dt', side_effect=[TEST_UPLOAD_DT, TEST_UPLOAD_DT2])
def test_upload_self(self, extension, _mock_make_image_version, mock_log):

    with make_image_file(extension=extension) as image_file:
        response = self.client.post(self.url, {'file': image_file}, format='multipart')
        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()
    with make_image_file() as image_file:
        response = self.client.post(self.url, {'file': image_file}, format='multipart')
        self.check_response(response, 204)
    self.check_upload_event_emitted(old=TEST_UPLOAD_DT, new=TEST_UPLOAD_DT2)
