def METHOD_NAME(db, note, dummy_user):
    note.create_revision(RenderMode.html, 'first', dummy_user)
    rev = note.create_revision(RenderMode.html, 'second', dummy_user)
    db.session.add(note)
    db.session.flush()
    note.revisions.remove(rev)
    with pytest.raises(IntegrityError):
        db.session.flush()