def METHOD_NAME(self, db_session):
    db_session.add(models.UserIdentity(provider="provider", provider_unique_id="1"))
    with pytest.raises(
        sqlalchemy.exc.IntegrityError,
        match='null value in column "user_id" violates not-null constraint',
    ):
        db_session.flush()