pki.tests.test_views_truststoresΒΆ

Tests for pki.views.truststores module.

ClassesΒΆ

TestTruststoreTableView

Test the TruststoreTableView class.

TestTruststoreCreateView

Tests for TruststoreCreateView dispatch and form_valid.

TestTruststoreCreateViewFormValid

Tests covering form_valid branches.

Module ContentsΒΆ

class pki.tests.test_views_truststores.TestTruststoreTableView[source]ΒΆ

Test the TruststoreTableView class.

truststore_instances()[source]ΒΆ

Create test truststore instances.

test_get_queryset_without_filters(truststore_instances)[source]ΒΆ

Test get_queryset returns all truststores when no filters applied.

test_get_queryset_with_unique_name_filter(truststore_instances)[source]ΒΆ

Test get_queryset applies unique_name filter.

test_get_queryset_with_partial_unique_name_filter(truststore_instances)[source]ΒΆ

Test get_queryset applies partial unique_name filter (icontains).

test_get_queryset_with_intended_usage_filter(truststore_instances)[source]ΒΆ

Test get_queryset applies intended_usage filter.

test_get_queryset_with_issuing_ca_chain_filter(truststore_instances)[source]ΒΆ

Test get_queryset filters for ISSUING_CA_CHAIN intended usage.

test_get_queryset_with_combined_filters(truststore_instances)[source]ΒΆ

Test get_queryset applies combined filters.

test_get_queryset_with_combined_filters_no_match(truststore_instances)[source]ΒΆ

Test get_queryset returns empty queryset when combined filters don’t match.

test_get_context_data_includes_filter(truststore_instances)[source]ΒΆ

Test that get_context_data includes the filter in context.

test_filterset_is_stored_as_attribute(truststore_instances)[source]ΒΆ

Test that the filterset is stored as a view attribute after get_queryset.

test_apply_filters_method(truststore_instances)[source]ΒΆ

Test the apply_filters method directly.

class pki.tests.test_views_truststores.TestTruststoreCreateView[source]ΒΆ

Tests for TruststoreCreateView dispatch and form_valid.

factory()[source]ΒΆ
test_dispatch_full_flow_true(factory)[source]ΒΆ

Full dispatch test with setup for from-device.

test_dispatch_full_flow_false(factory)[source]ΒΆ

Full dispatch test for normal path.

test_path_logic_direct(factory)[source]ΒΆ

Direct test of dispatch if-statement (NO dispatch call).

test_dispatch_parametrized(factory, path, expected_for_devid)[source]ΒΆ

Test for Parametrized full dispatch with proper setup.

class pki.tests.test_views_truststores.TestTruststoreCreateViewFormValid[source]ΒΆ

Tests covering form_valid branches.

view()[source]ΒΆ
mock_form()[source]ΒΆ
test_domain_id_branch(mock_messages, view, mock_form)[source]ΒΆ

Test if domain_id is present.

test_for_devid_query_branch(mock_messages, view, mock_form)[source]ΒΆ

Test if getattr(self, β€˜for_devid’, False)

test_messages_plural_success(mock_messages, view, mock_form)[source]ΒΆ

Test for normal success + ngettext plural.

test_messages_singular_success(mock_messages, view, mock_form)[source]ΒΆ

Test ngettext singular.