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