Skip to main content

ClientHandler

An HTTP Handler that can be used for testing purposes. Use the WSGI interface to compose requests, but return the raw HttpResponse object with the originating WSGIRequest attached to its wsgi_request attribute.

Attributes

AttributeTypeDescription
enforce_csrf_checksboolean = TrueA boolean flag that determines whether the handler should validate CSRF tokens on incoming requests.

Constructor

Signature

def ClientHandler(
enforce_csrf_checks: boolean = True,
*args: any,
**kwargs: any
)

Parameters

NameTypeDescription
enforce_csrf_checksboolean = TrueDetermines whether CSRF protection middleware should be enforced during requests.
*argsanyVariable length argument list passed to the base class.
**kwargsanyArbitrary keyword arguments passed to the base class.