DocCode: add validation test "Detaching entity clears validation errors"