management.tests.test_security_featuresΒΆ
Test suite for security features.
ClassesΒΆ
Mock security feature for testing. |
|
Test suite for SecurityFeature abstract base class. |
|
Test suite for AutoGenPkiFeature. |
Module ContentsΒΆ
- class management.tests.test_security_features.MockSecurityFeature[source]ΒΆ
Bases:
management.security.features.SecurityFeatureMock security feature for testing.
- classmethod enable(**kwargs)[source]ΒΆ
Mock enable method.
- Parameters:
kwargs (object)
- Return type:
None
- class management.tests.test_security_features.SecurityFeatureTest(methodName='runTest')[source]ΒΆ
Bases:
django.test.TestCaseTest suite for SecurityFeature abstract base class.
- test_security_feature_is_abstract()[source]ΒΆ
Test that SecurityFeature cannot be instantiated directly.
- test_security_feature_has_verbose_name()[source]ΒΆ
Test that SecurityFeature has verbose_name class attribute.
- class management.tests.test_security_features.AutoGenPkiFeatureTest(methodName='runTest')[source]ΒΆ
Bases:
django.test.TestCaseTest suite for AutoGenPkiFeature.
- test_is_enabled_returns_false_when_disabled()[source]ΒΆ
Test is_enabled returns False when auto_gen_pki is False.
- test_is_enabled_returns_true_when_enabled()[source]ΒΆ
Test is_enabled returns True when auto_gen_pki is True.
- test_is_enabled_returns_false_when_no_config()[source]ΒΆ
Test is_enabled returns False when no SecurityConfig exists.
- test_enable_starts_thread_when_enabled(mock_enable)[source]ΒΆ
Test enable starts a background thread when auto_gen_pki is True.
- test_enable_raises_error_without_key_algorithm()[source]ΒΆ
Test enable raises ValueError when key_algorithm is not provided.
- test_enable_does_not_start_thread_when_disabled()[source]ΒΆ
Test enable does not start thread when auto_gen_pki is False.
- test_enable_handles_exceptions_in_thread(mock_enable)[source]ΒΆ
Test enable handles exceptions that occur in the background thread.
- test_enable_with_different_key_algorithms(mock_enable)[source]ΒΆ
Test enable works with different key algorithms.
- test_disable_updates_security_config(mock_disable)[source]ΒΆ
Test disable updates SecurityConfig.auto_gen_pki to False.
- test_disable_handles_no_security_config(mock_disable)[source]ΒΆ
Test disable handles case when no SecurityConfig exists.
- test_disable_handles_exceptions_in_thread(mock_disable)[source]ΒΆ
Test disable handles exceptions that occur in the background thread.
- test_disable_accepts_kwargs(mock_disable)[source]ΒΆ
Test disable accepts kwargs (even though theyβre unused).