Skip to content

test: Add unit tests for App Login Flow (get_cookie_for_app, apply_login_cookie)#1661

Draft
sveneberth wants to merge 6 commits into
viur-framework:mainfrom
sveneberth:feat/tests
Draft

test: Add unit tests for App Login Flow (get_cookie_for_app, apply_login_cookie)#1661
sveneberth wants to merge 6 commits into
viur-framework:mainfrom
sveneberth:feat/tests

Conversation

@sveneberth
Copy link
Copy Markdown
Member

Tests cover session creation, Set-Cookie format, redirect whitelist enforcement (fnmatch patterns, callable whitelist, star wildcard, blocked targets) and session activation via apply_login_cookie.

…gin_cookie)

Tests cover session creation, Set-Cookie format, redirect whitelist enforcement
(fnmatch patterns, callable whitelist, star wildcard, blocked targets) and
session activation via apply_login_cookie.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sveneberth sveneberth added Priority: Medium This issue may be useful, and needs some attention. Tests Changes on the unittests labels Apr 2, 2026
sveneberth and others added 5 commits April 2, 2026 02:32
Add unit tests for:
- utils: ensure_iterable, build_content_disposition_header, parse.bool/sortorder,
  string.normalize_ascii/is_prefix/random
- bones: BooleanBone, ColorBone, EmailBone, JsonBone, PasswordBone, PhoneBone, SelectBone
- errors: all HTTP exception classes and Redirect validation
- decorators: @Exposed, @internal_exposed, @force_post, @force_ssl, @cors, @access
  (no-user, root bypass, single/combined access rights, callable checks, offer_login)

Coverage highlights: parse.py 100%, phone 98%, email 92%, color 97%, errors 99%

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Consecutive dots, leading dot and trailing dot in the local part are now
rejected. Previously the bone accepted 'first..last@example.com' because
it only checked for valid characters, not structural dot rules.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…s; extend string/numeric

New test files:
- CredentialBone: isInvalid, singleValueFromClient, multiple/languages restrictions, unserialize
- UidBone: init validation (pattern wildcards, fillchar, readOnly, multiple), structure()
- RawBone: passthrough behavior, type_suffix, no HTML escaping
- SelectCountryBone: ISO2/ISO3 modes, subgroups (dach/eu), custom list, sorting,
  singleValueUnserialize ISO code conversion
- SpatialBone: haversine distance (Munich↔Berlin, equator, symmetry), bounds validation,
  getGridSize, isInvalid, isEmpty, singleValueFromClient, singleValueUnserialize

Extended:
- StringBone: isInvalid (max/min_length), init validation, type_coerce_single_value,
  singleValueFromClient with/without escape_html
- NumericBone: singleValueFromClient (comma decimal, min/max bounds, precision, invalid str),
  init validation (min/max out of range), getEmptyValue type

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: Medium This issue may be useful, and needs some attention. Tests Changes on the unittests

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant