def METHOD_NAME(self):
    # Create existing token: RemoteToken, RemoteAccount, UserIdentity.
    with db.session.begin_nested():
        # Create RemoteToken and RemoteAccount.
        RemoteToken.create(
            user_id=self.user.id,
            client_id=current_app.config['ORCID_APP_CREDENTIALS']['consumer_key'],
            token=self.token,
            secret=None,
            extra_data={
                'orcid': self.orcid,
                'full_name': self.name,
                'allow_push': True,
            }
        )
        user_identity = UserIdentity(
            id=self.orcid,
            method='orcid',
            id_user=self.user.id
        )
        db.session.add(user_identity)
    with mock.patch('inspirehep.modules.orcid.tasks.oauth_link_external_id') as mock_oauth_link_external_id:
        # Mocking `oauth_link_external_id` is necessary because when running
        # with `isolated_app` it raises
        # "FlushError: New instance ... with identity key (...) conflicts with persistent instance ..."
        # rather than the standard and expected `IntegrityError` (which
        # is raised instead when run without `isolated_app`).
        mock_oauth_link_external_id.side_effect = AlreadyLinkedError(self.user, self.orcid)
        _link_user_and_token(self.user, self.name, self.orcid, self.token)
    self._assert_remote_account_and_remote_token_and_user_identity()