cmp.tests.test_viewsΒΆ

Tests for CMP views.

ClassesΒΆ

TestCmpInitializationRequestView

Tests for CmpInitializationRequestView.

TestCmpCertificationRequestView

Tests for CmpCertificationRequestView.

TestCmpRequestViewPathParamExtraction

Tests for path parameter extraction in CmpRequestView.

FunctionsΒΆ

request_factory()

Provide a Django RequestFactory.

mock_request_context()

Mock CmpCertificateRequestContext.

Module ContentsΒΆ

cmp.tests.test_views.request_factory()[source]ΒΆ

Provide a Django RequestFactory.

cmp.tests.test_views.mock_request_context()[source]ΒΆ

Mock CmpCertificateRequestContext.

class cmp.tests.test_views.TestCmpInitializationRequestView[source]ΒΆ

Tests for CmpInitializationRequestView.

test_http_method_names()[source]ΒΆ

Test that only POST method is allowed.

test_csrf_exempt_decorator()[source]ΒΆ

Test that CSRF exemption is applied to the view.

test_post_initialization_with_domain_only(mock_context_cls, mock_validator_cls, mock_parser_cls, mock_auth_cls, mock_authz_cls, mock_profile_validator_cls, mock_processor_cls, mock_responder_cls, request_factory, mock_request_context)[source]ΒΆ

Test POST request to initialization endpoint with domain name only.

test_post_initialization_with_certificate_profile(mock_context_cls, mock_validator_cls, mock_parser_cls, mock_auth_cls, mock_authz_cls, mock_profile_validator_cls, mock_processor_cls, mock_responder_cls, request_factory, mock_request_context)[source]ΒΆ

Test POST request to initialization endpoint with certificate profile.

test_post_authorization_with_correct_operations(mock_context_cls, mock_validator_cls, mock_parser_cls, mock_auth_cls, mock_authz_cls, mock_profile_validator_cls, mock_processor_cls, mock_responder_cls, request_factory, mock_request_context)[source]ΒΆ

Test that authorization is called with correct operations for initialization.

class cmp.tests.test_views.TestCmpCertificationRequestView[source]ΒΆ

Tests for CmpCertificationRequestView.

test_post_certification_with_domain_only(mock_context_cls, mock_validator_cls, mock_parser_cls, mock_auth_cls, mock_authz_cls, mock_profile_validator_cls, mock_processor_cls, mock_responder_cls, request_factory, mock_request_context)[source]ΒΆ

Test POST request to certification endpoint with domain name only.

test_post_certification_with_certificate_profile(mock_context_cls, mock_validator_cls, mock_parser_cls, mock_auth_cls, mock_authz_cls, mock_profile_validator_cls, mock_processor_cls, mock_responder_cls, request_factory, mock_request_context)[source]ΒΆ

Test POST request to certification endpoint with certificate profile.

test_post_authorization_with_certification_operation(mock_context_cls, mock_validator_cls, mock_parser_cls, mock_auth_cls, mock_authz_cls, mock_profile_validator_cls, mock_processor_cls, mock_responder_cls, request_factory, mock_request_context)[source]ΒΆ

Test that authorization is called with correct operations for certification.

class cmp.tests.test_views.TestCmpRequestViewPathParamExtraction[source]ΒΆ

Tests for path parameter extraction in CmpRequestView.

test_extract_path_no_params(request_factory)[source]ΒΆ

Test extraction with no path parameters.

test_extract_path_operation_only(request_factory)[source]ΒΆ

Test extraction with only operation.

test_extract_path_domain_only(request_factory)[source]ΒΆ

Test extraction with only domain name (with trailing slash).

test_extract_path_profile_only(request_factory)[source]ΒΆ

Test extraction with only certificate profile.

test_extract_path_profile_and_operation(request_factory)[source]ΒΆ

Test extraction with only certificate profile.

test_extract_path_domain_and_profile(request_factory)[source]ΒΆ

Test extraction with domain name and certificate profile.

test_extract_path_domain_and_profile_td(request_factory)[source]ΒΆ

Test extraction with domain name and certificate profile using ~ separator.

test_extract_path_domain_profile_td_operation(request_factory)[source]ΒΆ

Test extraction with domain name, certificate profile using ~ separator, and operation.

test_extract_path_domain_and_operation(request_factory)[source]ΒΆ

Test extraction with domain name and operation.

test_extract_path_all(request_factory)[source]ΒΆ

Test extraction with domain name, certificate profile, and operation.

test_extract_path_empty_domain(request_factory)[source]ΒΆ

Test extraction with empty domain segment.

test_extract_path_invalid_empty_profile_after_td(request_factory)[source]ΒΆ

Test extraction with empty profile in domain segment.

test_extract_path_invalid_profile_as_operation(request_factory)[source]ΒΆ

Test extraction fails with (second) profile given instead of operation.

test_extract_path_invalid_operation(request_factory)[source]ΒΆ

Test extraction with invalid operation.