management.tests.test_forms.test_pkcs11configform

Classes

PKCS11ConfigFormTestCase

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

Module Contents

class management.tests.test_forms.test_pkcs11configform.PKCS11ConfigFormTestCase(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 test environment.

test_form_initialization_with_existing_token()[source]

Test that the form initializes with existing token data.

test_form_initialization_without_existing_token()[source]

Test that the form initializes with default values if no token exists.

test_clean_with_softhsm()[source]

Test that the form sets default values for SoftHSM.

test_clean_label_unique()[source]

Test that the form always uses the SoftHSM label.

test_save_token_config_create(mock_get_or_create)[source]

Test that the form creates a new token configuration.

test_save_token_config_update_softhsm(mock_get_or_create)[source]

Test that the form updates an existing SoftHSM token configuration.