aeat.application.user_profile._testing module¶
Test conveniences over the canonical user-profile orchestration.
Wraps register_active_profile() with a curated set of required
schema-validated placeholder facts so unit tests can register a profile
in one call without reciting six placeholder values every time. An
explicit SecureObjectRepository
may be injected to bind the helper to an in-process ephemeral store.
This is a TEST helper and lives in the canonical package because it composes only canonical surfaces.
- register_minimal_profile(state, *, profile_id, display_name=None, overrides=None, secure_objects=None, enforce_unique_tax_id=True)[source]¶
Register
profile_idwith the minimum required schema facts.- Parameters:
state (
WorkflowState) – CurrentWorkflowState.profile_id (
str) – Canonical profile identifier (also the bucket id).display_name (
str|None) – Operator-visible label. Defaults toprofile_id.overrides (
Mapping[str,str] |None) – Optional schema-path → string overrides applied on top of the placeholder facts (also accepts paths not in the required set; they merge in).secure_objects (
SecureObjectRepository|None) – Optional injectedSecureObjectRepository.enforce_unique_tax_id (
bool) – WhenFalse, skip the cross-bucket tax-id uniqueness scan. Use in per-bucket-storage test scenarios where each profile’s encrypted record lives in its own SQLite file and opening a second bucket session to scan a previously-created profile is not possible within the current active session. Matches the CLIprofile createbehaviour (which also passesenforce_unique_tax_id=False).
- Return type:
- Returns:
The state with the profile registered + activated and the
profile.created/profile.selectedworkflow events appended.