setup_wizard.tests.test_views.test_setupwizardhsmsetupview_extendedΒΆ

Comprehensive tests for SetupWizardHsmSetupView dispatch and form handling.

ClassesΒΆ

TestSetupWizardHsmSetupViewDispatch

Test dispatch method of SetupWizardHsmSetupView.

TestSetupWizardHsmSetupViewFormMethods

Test form-related methods of SetupWizardHsmSetupView.

TestSetupWizardHsmSetupViewHelperMethods

Test helper methods of SetupWizardHsmSetupView.

TestSetupWizardHsmSetupViewFormValidIntegration

Test form_valid integration with various scenarios.

Module ContentsΒΆ

class setup_wizard.tests.test_views.test_setupwizardhsmsetupview_extended.TestSetupWizardHsmSetupViewDispatch[source]ΒΆ

Test dispatch method of SetupWizardHsmSetupView.

setup_method()[source]ΒΆ

Set up test fixtures.

test_dispatch_not_in_docker_container()[source]ΒΆ

Test dispatch redirects when not in Docker container.

test_dispatch_wrong_wizard_state(mock_redirect, mock_get_state)[source]ΒΆ

Test dispatch redirects when wizard is in wrong state.

test_dispatch_invalid_hsm_type(mock_get_state)[source]ΒΆ

Test dispatch with invalid HSM type.

test_dispatch_storage_type_mismatch_softhsm(mock_get_config, mock_get_state)[source]ΒΆ

Test dispatch when storage type doesn’t match requested HSM type (softhsm).

test_dispatch_storage_type_mismatch_physical(mock_get_config, mock_get_state)[source]ΒΆ

Test dispatch when storage type doesn’t match requested HSM type (physical).

test_dispatch_config_exception(mock_get_config, mock_get_state)[source]ΒΆ

Test dispatch handles exception when getting config.

class setup_wizard.tests.test_views.test_setupwizardhsmsetupview_extended.TestSetupWizardHsmSetupViewFormMethods[source]ΒΆ

Test form-related methods of SetupWizardHsmSetupView.

setup_method()[source]ΒΆ

Set up test fixtures.

test_get_form_with_softhsm()[source]ΒΆ

Test get_form returns form with softhsm defaults.

test_get_form_with_physical()[source]ΒΆ

Test get_form returns form with physical HSM defaults.

test_get_form_with_custom_form_class()[source]ΒΆ

Test get_form with custom form class.

test_get_context_data()[source]ΒΆ

Test get_context_data adds HSM type information.

test_get_context_data_with_underscore()[source]ΒΆ

Test get_context_data handles underscore in HSM type.

class setup_wizard.tests.test_views.test_setupwizardhsmsetupview_extended.TestSetupWizardHsmSetupViewHelperMethods[source]ΒΆ

Test helper methods of SetupWizardHsmSetupView.

setup_method()[source]ΒΆ

Set up test fixtures.

test_get_setup_type()[source]ΒΆ

Test get_setup_type returns init_setup.

test_get_success_url()[source]ΒΆ

Test get_success_url returns setup_mode URL.

test_get_error_redirect_url()[source]ΒΆ

Test get_error_redirect_url returns hsm_setup.

test_get_success_context()[source]ΒΆ

Test get_success_context returns initial setup context.

test_get_expected_wizard_state()[source]ΒΆ

Test get_expected_wizard_state returns WIZARD_SETUP_HSM.

class setup_wizard.tests.test_views.test_setupwizardhsmsetupview_extended.TestSetupWizardHsmSetupViewFormValidIntegration[source]ΒΆ

Test form_valid integration with various scenarios.

setup_method()[source]ΒΆ

Set up test fixtures.

test_form_valid_success_with_token_creation(mock_get_or_create, mock_run, mock_get_config, mock_get_state)[source]ΒΆ

Test form_valid with successful token creation.

test_form_valid_script_failure(mock_get_or_create, mock_run, mock_get_config, mock_get_state)[source]ΒΆ

Test form_valid handles script execution failure.