Plugins
Test Utils
Use Kernia test fixtures for ASGI apps, providers, emails, SMS, Stripe, SAML, WebAuthn, and adapters.
The test utilities package gives integration tests deterministic fixtures for auth flows that normally require third-party providers or real browsers.
Installation
uv add --dev kernia-test-utilsImport path
from kernia_test_utils import ASGIDriver, MockIdP, MockSMTP, MockStripe, SoftAuthenticatorServer configuration
import os
from kernia import KerniaOptions
from kernia.auth import init
from kernia_test_utils import ASGIDriver, MockIdP, MockSMTP, MockStripe, SoftAuthenticator
from .db import adapter
auth = init(KerniaOptions(
database=adapter,
secret=os.environ["KERNIA_SECRET"],
base_url=os.environ["KERNIA_BASE_URL"],
base_path="/api/auth",
plugins=(
# test utilities are imported by tests, not configured as a production plugin
),
))API routes
Schema impact
No application schema changes. Some fixtures create temporary adapter state or containers during tests.
Behavior and options
ASGIDrivercalls mounted ASGI apps without a live server.MockIdPsigns test OIDC tokens.MockSMTPandMockSMScapture outbound messages.MockStripeverifies webhooks and mocks Stripe REST calls.SoftAuthenticatordrives passkey tests.