devices.tests.test_forms.test_device_creation_formsΒΆ

Tests for device creation forms.

ClassesΒΆ

TestNoOnboardingCreateForm

Tests for NoOnboardingCreateForm.

TestOnboardingCreateForm

Tests for OnboardingCreateForm.

TestRevokeIssuedCredentialForm

Tests for RevokeIssuedCredentialForm.

TestRevokeDevicesForm

Tests for RevokeDevicesForm.

TestDeleteDevicesForm

Tests for DeleteDevicesForm.

TestOpcUaGdsPushCreateForm

Tests for OpcUaGdsPushCreateForm.

TestOpcUaGdsPushTruststoreAssociationForm

Tests for OpcUaGdsPushTruststoreAssociationForm.

Module ContentsΒΆ

class devices.tests.test_forms.test_device_creation_forms.TestNoOnboardingCreateForm[source]ΒΆ

Tests for NoOnboardingCreateForm.

test_form_initialization()[source]ΒΆ

Test NoOnboardingCreateForm initialization.

Return type:

None

test_form_fields_required()[source]ΒΆ

Test which fields are required.

Return type:

None

test_valid_form_data(device_instance)[source]ΒΆ

Test form with valid data.

Parameters:

device_instance (dict[str, Any])

Return type:

None

test_duplicate_common_name(device_instance)[source]ΒΆ

Test that duplicate common_name is rejected.

Parameters:

device_instance (dict[str, Any])

Return type:

None

test_form_without_domain()[source]ΒΆ

Test form submission without a domain (domain is optional).

Return type:

None

test_multiple_pki_protocols(device_instance)[source]ΒΆ

Test form with multiple PKI protocols selected.

Parameters:

device_instance (dict[str, Any])

Return type:

None

test_save_creates_device(device_instance)[source]ΒΆ

Test that save() method creates a DeviceModel.

Parameters:

device_instance (dict[str, Any])

Return type:

None

test_save_with_cmp_shared_secret(device_instance)[source]ΒΆ

Test that CMP shared secret is generated when protocol is selected.

Parameters:

device_instance (dict[str, Any])

Return type:

None

test_save_with_est_username_password(device_instance)[source]ΒΆ

Test that EST password is generated when protocol is selected.

Parameters:

device_instance (dict[str, Any])

Return type:

None

class devices.tests.test_forms.test_device_creation_forms.TestOnboardingCreateForm[source]ΒΆ

Tests for OnboardingCreateForm.

test_form_initialization()[source]ΒΆ

Test OnboardingCreateForm initialization.

Return type:

None

test_valid_form_data(device_instance)[source]ΒΆ

Test form with valid onboarding data.

Parameters:

device_instance (dict[str, Any])

Return type:

None

test_duplicate_common_name(device_instance)[source]ΒΆ

Test that duplicate common_name is rejected in onboarding form.

Parameters:

device_instance (dict[str, Any])

Return type:

None

test_save_creates_device_with_onboarding(device_instance)[source]ΒΆ

Test that save() creates a device with onboarding config.

Parameters:

device_instance (dict[str, Any])

Return type:

None

test_save_with_cmp_generates_secret(device_instance)[source]ΒΆ

Test that CMP shared secret is generated for onboarding.

Parameters:

device_instance (dict[str, Any])

Return type:

None

test_save_with_est_generates_password(device_instance)[source]ΒΆ

Test that EST password is generated for onboarding.

Parameters:

device_instance (dict[str, Any])

Return type:

None

class devices.tests.test_forms.test_device_creation_forms.TestRevokeIssuedCredentialForm[source]ΒΆ

Tests for RevokeIssuedCredentialForm.

test_form_initialization()[source]ΒΆ

Test RevokeIssuedCredentialForm has revocation_reason field.

Return type:

None

test_form_is_modelform()[source]ΒΆ

Test that RevokeIssuedCredentialForm is a ModelForm.

Return type:

None

class devices.tests.test_forms.test_device_creation_forms.TestRevokeDevicesForm[source]ΒΆ

Tests for RevokeDevicesForm.

test_form_initialization()[source]ΒΆ

Test RevokeDevicesForm has pks and revocation_reason fields.

Return type:

None

class devices.tests.test_forms.test_device_creation_forms.TestDeleteDevicesForm[source]ΒΆ

Tests for DeleteDevicesForm.

test_form_initialization()[source]ΒΆ

Test DeleteDevicesForm has pks field.

Return type:

None

test_form_with_data()[source]ΒΆ

Test DeleteDevicesForm with sample data.

Return type:

None

class devices.tests.test_forms.test_device_creation_forms.TestOpcUaGdsPushCreateForm[source]ΒΆ

Tests for OpcUaGdsPushCreateForm.

test_form_initialization()[source]ΒΆ

Test OpcUaGdsPushCreateForm initialization.

Return type:

None

test_form_fields_required()[source]ΒΆ

Test which fields are required.

Return type:

None

test_valid_form_data(device_instance)[source]ΒΆ

Test form with valid data.

Parameters:

device_instance (dict[str, Any])

Return type:

None

test_duplicate_common_name_validation(device_instance)[source]ΒΆ

Test that duplicate common names are rejected.

Parameters:

device_instance (dict[str, Any])

Return type:

None

test_invalid_ip_address()[source]ΒΆ

Test form with invalid IP address.

Return type:

None

test_invalid_port_range()[source]ΒΆ

Test form with invalid port numbers.

Return type:

None

class devices.tests.test_forms.test_device_creation_forms.TestOpcUaGdsPushTruststoreAssociationForm[source]ΒΆ

Tests for OpcUaGdsPushTruststoreAssociationForm.

test_form_initialization(device_instance_onboarding)[source]ΒΆ

Test form initialization with device instance.

Parameters:

device_instance_onboarding (dict[str, Any])

Return type:

None

test_save_associates_truststore(device_instance_onboarding)[source]ΒΆ

Test that save() associates the truststore with the device.

Parameters:

device_instance_onboarding (dict[str, Any])

Return type:

None