thunderbird_accounts.subscription.management.commands.create_active_subscription_for_e2e_test

Bootstrap an active Subscription for an e2e test account.

Classes

Command([stdout, stderr, no_color, force_color])

Used for e2e tests that need to traverse routes the Vue router gates behind an active subscription (e.g. /manage-mfa).

class thunderbird_accounts.subscription.management.commands.create_active_subscription_for_e2e_test.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: BaseCommand

Used for e2e tests that need to traverse routes the Vue router gates behind an active subscription (e.g. /manage-mfa). Idempotent — safe to run more than once.

Looks up the Keycloak user by username so the Django User row carries the matching oidc_id; otherwise mozilla-django-oidc would create a duplicate user on first sign-in.

Usage:

python manage.py create_active_subscription_for_e2e_test admin@example.org
add_arguments(parser)[source]

Entry point for subclassed commands to add custom arguments.

handle(*args, **options)[source]

The actual logic of the command. Subclasses must implement this method.