pki.tests.test_models.test_credentialΒΆ

Tests for PKI credential models.

ClassesΒΆ

TestCredentialAlreadyExistsError

Test the CredentialAlreadyExistsError exception.

TestPKCS11Key

Test the PKCS11Key model.

TestCertificateChainOrderModel

Test the CertificateChainOrderModel.

TestIDevIDReferenceModel

Test the IDevIDReferenceModel.

TestPKCS11KeyTypeEnum

Test the PKCS11Key.KeyType enum.

TestPKCS11KeyDatabaseConstraints

Test database constraints and behaviors for PKCS11Key.

Module ContentsΒΆ

class pki.tests.test_models.test_credential.TestCredentialAlreadyExistsError[source]ΒΆ

Test the CredentialAlreadyExistsError exception.

test_error_creation()[source]ΒΆ

Test creating a CredentialAlreadyExistsError.

test_error_can_be_raised()[source]ΒΆ

Test that the error can be raised and caught.

test_error_message()[source]ΒΆ

Test that error has the correct message.

class pki.tests.test_models.test_credential.TestPKCS11Key[source]ΒΆ

Test the PKCS11Key model.

test_create_pkcs11_key_rsa()[source]ΒΆ

Test creating a PKCS11Key with RSA type.

test_create_pkcs11_key_ec()[source]ΒΆ

Test creating a PKCS11Key with EC type.

test_create_pkcs11_key_aes()[source]ΒΆ

Test creating a PKCS11Key with AES type.

test_pkcs11_key_str()[source]ΒΆ

Test string representation of PKCS11Key.

test_pkcs11_key_unique_together()[source]ΒΆ

Test that token_label and key_label must be unique together.

test_pkcs11_key_different_tokens_same_label()[source]ΒΆ

Test that same key_label can exist on different tokens.

test_pkcs11_key_type_choices()[source]ΒΆ

Test that KeyType has all expected choices.

test_pkcs11_key_verbose_names()[source]ΒΆ

Test that model has correct verbose names.

test_pkcs11_key_field_max_lengths()[source]ΒΆ

Test that fields have correct max lengths.

test_pkcs11_key_created_at_auto()[source]ΒΆ

Test that created_at is set automatically.

test_pkcs11_key_can_be_deleted()[source]ΒΆ

Test that PKCS11Key can be deleted.

class pki.tests.test_models.test_credential.TestCertificateChainOrderModel[source]ΒΆ

Test the CertificateChainOrderModel.

test_certificate_chain_order_model_exists()[source]ΒΆ

Test that CertificateChainOrderModel is importable.

test_certificate_chain_order_has_order_field()[source]ΒΆ

Test that model has an order field.

class pki.tests.test_models.test_credential.TestIDevIDReferenceModel[source]ΒΆ

Test the IDevIDReferenceModel.

test_idevid_reference_model_exists()[source]ΒΆ

Test that IDevIDReferenceModel is importable.

test_idevid_reference_model_name()[source]ΒΆ

Test that model has correct name.

test_idevid_reference_has_meta()[source]ΒΆ

Test that model has Meta class.

class pki.tests.test_models.test_credential.TestPKCS11KeyTypeEnum[source]ΒΆ

Test the PKCS11Key.KeyType enum.

test_key_type_is_text_choices()[source]ΒΆ

Test that KeyType is a TextChoices.

test_key_type_values()[source]ΒΆ

Test KeyType enum values.

test_key_type_labels()[source]ΒΆ

Test KeyType enum labels.

test_key_type_choices()[source]ΒΆ

Test that KeyType provides choices for forms.

class pki.tests.test_models.test_credential.TestPKCS11KeyDatabaseConstraints[source]ΒΆ

Test database constraints and behaviors for PKCS11Key.

test_token_label_required()[source]ΒΆ

Test that token_label is required.

test_key_label_required()[source]ΒΆ

Test that key_label is required.

test_key_type_required()[source]ΒΆ

Test that key_type is required.

test_multiple_keys_same_token()[source]ΒΆ

Test that multiple keys can exist on the same token.

test_query_by_token_label()[source]ΒΆ

Test querying keys by token label.

test_query_by_key_type()[source]ΒΆ

Test querying keys by type.

test_update_key_label()[source]ΒΆ

Test that key_label can be updated.

test_update_token_label()[source]ΒΆ

Test that token_label can be updated.