setup_wizard.tests.test_forms.test_hsmsetupform

Classes

HsmSetupFormTestCase

Similar to TransactionTestCase, but use transaction.atomic() to achieve

Module Contents

class setup_wizard.tests.test_forms.test_hsmsetupform.HsmSetupFormTestCase(methodName='runTest')[source]

Bases: django.test.TestCase

Similar to TransactionTestCase, but use transaction.atomic() to achieve test isolation.

In most situations, TestCase should be preferred to TransactionTestCase as it allows faster execution. However, there are some situations where using TransactionTestCase might be necessary (e.g. testing some transactional behavior).

On database backends with no transaction support, TestCase behaves as TransactionTestCase.

setUp()[source]

Set up valid data for testing.

test_form_initialization()[source]

Test that the form initializes with default values.

test_valid_data_for_softhsm()[source]

Test that the form is valid with correct data for SoftHSM.

test_invalid_hsm_type()[source]

Test that the form is invalid with an unsupported HSM type.

test_physical_hsm_not_supported()[source]

Test that the form raises an error for physical HSM.

test_clean_label_for_softhsm()[source]

Test that the label is overridden for SoftHSM.

test_clean_slot_for_softhsm()[source]

Test that the slot is overridden for SoftHSM.

test_clean_module_path_for_softhsm()[source]

Test that the module path is overridden for SoftHSM.

test_missing_required_fields()[source]

Test that the form is invalid if required fields are missing.