setup_wizard.tests.test_views.test_setupwizardhsmsetupview

Tests for the SetupWizardHsmSetupView.

Classes

SetupWizardHsmSetupViewTestCase

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

Module Contents

class setup_wizard.tests.test_views.test_setupwizardhsmsetupview.SetupWizardHsmSetupViewTestCase(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 data and authenticate the test client.

test_get_request_renders_form(mock_dispatch)[source]

Test that a GET request renders the form.

test_post_request_valid_data(mock_dispatch)[source]

Test that a POST request with valid data processes successfully.

test_post_request_invalid_hsm_type(mock_dispatch)[source]

Test that a POST request with an unsupported HSM type shows an error.

test_post_request_invalid_inputs(mock_dispatch)[source]

Test that invalid HSM inputs show an error.

test_post_request_script_failure(mock_dispatch)[source]

Test that a script failure shows an error.

test_post_request_token_creation_failure(mock_dispatch)[source]

Test that a token creation failure shows an error.