From 3f66e9b76cccb450c91a860f13f43accabc83e82 Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Sun, 22 Feb 2026 16:20:15 +0100 Subject: [PATCH] add options for content-type and accept --- radicale/tests/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/radicale/tests/__init__.py b/radicale/tests/__init__.py index 5b637159..30e8999d 100644 --- a/radicale/tests/__init__.py +++ b/radicale/tests/__init__.py @@ -89,6 +89,8 @@ class BaseTest: (str, type(http_if_match))) remote_useragent = kwargs.pop("remote_useragent", None) remote_host = kwargs.pop("remote_host", None) + content_type = kwargs.pop("content_type", None) + accept = kwargs.pop("accept", None) environ: Dict[str, Any] = {k.upper(): v for k, v in kwargs.items()} for k, v in environ.items(): if not isinstance(v, str): @@ -104,6 +106,10 @@ class BaseTest: environ["HTTP_USER_AGENT"] = remote_useragent if remote_host: environ["REMOTE_ADDR"] = remote_host + if content_type: + environ["CONTENT_TYPE"] = content_type + if accept: + environ["HTTP_ACCEPT"] = accept environ["REQUEST_METHOD"] = method.upper() environ["PATH_INFO"] = path if data is not None: