diff --git a/ca/django_ca/tests/views/test_generic_ocsp_view.py b/ca/django_ca/tests/views/test_generic_ocsp_view.py index f7c9e5ba9..ae9832190 100644 --- a/ca/django_ca/tests/views/test_generic_ocsp_view.py +++ b/ca/django_ca/tests/views/test_generic_ocsp_view.py @@ -31,6 +31,7 @@ import pytest from _pytest.logging import LogCaptureFixture +from pytest_django import DjangoAssertNumQueries from django_ca.conf import model_settings from django_ca.key_backends.hsm.models import HSMUsePrivateKeyOptions @@ -57,9 +58,15 @@ def child_cert(tmpcadir: Path, child_cert: Certificate, profile_ocsp: Certificat return child_cert -def test_get(client: Client, child_cert: Certificate, profile_ocsp: Certificate) -> None: +def test_get( + django_assert_num_queries: DjangoAssertNumQueries, + client: Client, + child_cert: Certificate, + profile_ocsp: Certificate, +) -> None: """Test getting OCSP responses.""" - response = ocsp_get(client, child_cert) + with django_assert_num_queries(2): + response = ocsp_get(client, child_cert) assert_ocsp_response(response, child_cert, responder_certificate=profile_ocsp) diff --git a/ca/django_ca/views.py b/ca/django_ca/views.py index 03c2ee3fc..0eb79d404 100644 --- a/ca/django_ca/views.py +++ b/ca/django_ca/views.py @@ -467,8 +467,7 @@ async def process_ocsp_request(self, data: bytes) -> HttpResponse: class GenericOCSPView(OCSPView): """View providing auto-configured OCSP functionality. - This view assumes that ``ocsp/$ca_serial.(key|pem)`` point to the private/public key of a responder - certificate as created by :py:class:`~django_ca.tasks.generate_ocsp_keys`. The ``serial`` URL keyword + This view loads the responder certificate via the OCSP key backend. The ``serial`` URL keyword argument must be the serial for this CA. """