def METHOD_NAME(self, test_data):
    user = test_data["user1"]
    invite = Collaboration(project_id=None, user_id=user.id)
    DB.session.add(invite)
    with pytest.raises(IntegrityError):
        DB.session.commit()
    DB.session.rollback()
    assert crud.count_collaborations() == 0