pki.tests.test_forms_extendedΒΆ

Comprehensive tests for PKI forms module - focused on increasing coverage.

ClassesΒΆ

TestGetPrivateKeyLocationFromConfig

Test the get_private_key_location_from_config function.

TestDevIdAddMethodSelectForm

Test the DevIdAddMethodSelectForm.

TestDevIdRegistrationForm

Test the DevIdRegistrationForm.

TestIssuingCaAddMethodSelectForm

Test the IssuingCaAddMethodSelectForm.

TestIssuingCaFileTypeSelectForm

Test IssuingCaFileTypeSelectForm.

TestTruststoreDownloadForm

Test the TruststoreDownloadForm.

TestCertificateDownloadForm

Test the CertificateDownloadForm.

TestCertProfileConfigForm

Test the CertProfileConfigForm.

TestTruststoreAddForm

Test TruststoreAddForm.

TestTruststoreAddFormValidation

Test TruststoreAddForm validation with actual files.

TestIssuingCaAddFileImportPkcs12Form

Test IssuingCaAddFileImportPkcs12Form.

TestIssuingCaAddFileImportSeparateFilesForm

Test IssuingCaAddFileImportSeparateFilesForm.

TestOwnerCredentialFileImportForm

Test OwnerCredentialFileImportForm.

TestIssuingCaFileTypeSelectForm

Test IssuingCaFileTypeSelectForm.

TestFormFieldAttributes

Test various form field attributes and widgets.

Module ContentsΒΆ

class pki.tests.test_forms_extended.TestGetPrivateKeyLocationFromConfig[source]ΒΆ

Test the get_private_key_location_from_config function.

test_returns_hsm_provided_for_softhsm()[source]ΒΆ

Test that HSM_PROVIDED is returned for SOFTHSM storage type.

test_returns_hsm_provided_for_physical_hsm()[source]ΒΆ

Test that HSM_PROVIDED is returned for PHYSICAL_HSM storage type.

test_returns_software_when_config_does_not_exist()[source]ΒΆ

Test that SOFTWARE is returned when KeyStorageConfig does not exist.

class pki.tests.test_forms_extended.TestDevIdAddMethodSelectForm[source]ΒΆ

Test the DevIdAddMethodSelectForm.

test_form_valid_with_import_truststore()[source]ΒΆ

Test form is valid when import_truststore is selected.

test_form_valid_with_configure_pattern()[source]ΒΆ

Test form is valid when configure_pattern is selected.

test_form_invalid_with_empty_data()[source]ΒΆ

Test form is invalid when no method is selected.

test_form_invalid_with_invalid_choice()[source]ΒΆ

Test form is invalid with an invalid choice.

test_form_initial_value()[source]ΒΆ

Test that the initial value is configure_pattern.

test_form_field_label()[source]ΒΆ

Test that the field has the correct label.

class pki.tests.test_forms_extended.TestDevIdRegistrationForm[source]ΒΆ

Test the DevIdRegistrationForm.

setup_method()[source]ΒΆ

Set up test fixtures.

test_form_valid_with_all_fields()[source]ΒΆ

Test form is valid with all required and optional fields.

test_form_valid_without_optional_unique_name()[source]ΒΆ

Test form is valid without the optional unique_name field.

test_form_invalid_without_required_fields()[source]ΒΆ

Test form is invalid when required fields are missing.

test_form_invalid_with_duplicate_unique_name()[source]ΒΆ

Test form is invalid with a duplicate unique_name.

test_form_has_expected_fields()[source]ΒΆ

Test that form has all expected fields.

test_unique_name_field_not_required()[source]ΒΆ

Test that unique_name field is optional.

test_serial_number_pattern_placeholder()[source]ΒΆ

Test that serial_number_pattern has placeholder text.

class pki.tests.test_forms_extended.TestIssuingCaAddMethodSelectForm[source]ΒΆ

Test the IssuingCaAddMethodSelectForm.

test_form_valid_with_local_file_import()[source]ΒΆ

Test form is valid when local_file_import is selected.

test_form_valid_with_local_request()[source]ΒΆ

Test form is valid when local_request is selected.

test_form_valid_with_remote_est()[source]ΒΆ

Test form is valid when remote_est is selected.

test_form_invalid_with_empty_data()[source]ΒΆ

Test form is invalid when no method is selected.

test_form_initial_value()[source]ΒΆ

Test that the initial value is local_file_import.

test_form_has_three_choices()[source]ΒΆ

Test that form has exactly three choices.

class pki.tests.test_forms_extended.TestIssuingCaFileTypeSelectForm[source]ΒΆ

Test the IssuingCaFileTypeSelectForm.

test_form_valid_with_pkcs_12()[source]ΒΆ

Test form is valid when pkcs_12 is selected.

test_form_valid_with_other()[source]ΒΆ

Test form is valid when other is selected.

test_form_invalid_with_empty_data()[source]ΒΆ

Test form is invalid when no file type is selected.

test_form_initial_value()[source]ΒΆ

Test that the initial value is pkcs_12.

test_form_has_two_choices()[source]ΒΆ

Test that form has exactly two choices.

class pki.tests.test_forms_extended.TestTruststoreDownloadForm[source]ΒΆ

Test the TruststoreDownloadForm.

test_form_valid_with_all_fields()[source]ΒΆ

Test form is valid with all fields provided.

test_form_valid_with_zip_container()[source]ΒΆ

Test form is valid with zip container.

test_form_valid_with_tar_gz_container()[source]ΒΆ

Test form is valid with tar_gz container.

test_form_valid_with_pkcs7_der_format()[source]ΒΆ

Test form is valid with pkcs7_der format.

test_form_invalid_without_required_fields()[source]ΒΆ

Test form is invalid without required fields.

test_form_has_all_required_fields()[source]ΒΆ

Test that form has all required fields.

test_form_initial_values()[source]ΒΆ

Test that initial values are set correctly.

class pki.tests.test_forms_extended.TestCertificateDownloadForm[source]ΒΆ

Test the CertificateDownloadForm.

test_form_valid_with_pem_format()[source]ΒΆ

Test form is valid with PEM format.

test_form_valid_with_der_format()[source]ΒΆ

Test form is valid with DER format.

test_form_valid_with_pkcs7_format()[source]ΒΆ

Test form is valid with PKCS7 PEM format.

test_form_valid_with_pkcs7_der_format()[source]ΒΆ

Test form is valid with PKCS7 DER format.

test_form_invalid_without_required_fields()[source]ΒΆ

Test form is invalid without required fields.

test_form_has_expected_fields()[source]ΒΆ

Test that form has expected fields.

class pki.tests.test_forms_extended.TestCertProfileConfigForm[source]ΒΆ

Test the CertProfileConfigForm.

test_form_has_required_fields()[source]ΒΆ

Test that form has all required fields.

test_form_is_model_form()[source]ΒΆ

Test that form is a ModelForm for CertificateProfileModel.

test_form_with_valid_json()[source]ΒΆ

Test form with valid JSON profile data.

test_unique_name_has_maxlength()[source]ΒΆ

Test that unique_name field has maxlength attribute.

class pki.tests.test_forms_extended.TestTruststoreAddForm[source]ΒΆ

Test TruststoreAddForm.

test_form_has_required_fields()[source]ΒΆ

Test that form has all required fields.

test_form_file_field_is_required()[source]ΒΆ

Test that trust_store_file field is required.

test_form_unique_name_not_required()[source]ΒΆ

Test that unique_name field is not required.

class pki.tests.test_forms_extended.TestTruststoreAddFormValidation[source]ΒΆ

Test TruststoreAddForm validation with actual files.

test_form_valid_der_certificate()[source]ΒΆ

Test that form accepts DER encoded certificate.

class pki.tests.test_forms_extended.TestIssuingCaAddFileImportPkcs12Form[source]ΒΆ

Test IssuingCaAddFileImportPkcs12Form.

test_form_has_required_fields()[source]ΒΆ

Test that form has all required fields.

test_form_unique_name_not_required()[source]ΒΆ

Test that unique_name field is not required.

class pki.tests.test_forms_extended.TestIssuingCaAddFileImportSeparateFilesForm[source]ΒΆ

Test IssuingCaAddFileImportSeparateFilesForm.

test_form_has_required_fields()[source]ΒΆ

Test that form has all required fields.

test_form_optional_fields_not_required()[source]ΒΆ

Test that optional fields are not required.

class pki.tests.test_forms_extended.TestOwnerCredentialFileImportForm[source]ΒΆ

Test OwnerCredentialFileImportForm.

test_form_has_required_fields()[source]ΒΆ

Test that form has all required fields.

test_form_optional_fields_not_required()[source]ΒΆ

Test that optional fields are not required.

class pki.tests.test_forms_extended.TestIssuingCaFileTypeSelectForm[source]ΒΆ

Test IssuingCaFileTypeSelectForm.

test_form_has_file_type_field()[source]ΒΆ

Test that form has method_select field.

test_form_file_type_choices()[source]ΒΆ

Test method_select field has correct choices.

test_form_valid_with_pkcs12()[source]ΒΆ

Test form is valid with pkcs_12 choice.

test_form_valid_with_separate()[source]ΒΆ

Test form is valid with other choice.

class pki.tests.test_forms_extended.TestFormFieldAttributes[source]ΒΆ

Test various form field attributes and widgets.

test_dev_id_registration_form_fields()[source]ΒΆ

Test DevIdRegistrationForm field configuration.

test_certificate_download_form_format_choices()[source]ΒΆ

Test CertificateDownloadForm has correct format fields.

test_truststore_download_form_format_choices()[source]ΒΆ

Test TruststoreDownloadForm has correct format fields.

test_cert_profile_config_form_widgets()[source]ΒΆ

Test CertProfileConfigForm widget configuration.

test_issuing_ca_add_method_select_form_choices()[source]ΒΆ

Test IssuingCaAddMethodSelectForm has correct choices.