Update testing.py

This commit is contained in:
Juro Oravec 2025-09-10 22:09:23 +02:00 committed by GitHub
parent b5d0f3380b
commit d22299bec1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,7 +2,21 @@ import gc
import inspect import inspect
import sys import sys
from functools import wraps from functools import wraps
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Mapping, Optional, Sequence, Set, Tuple, Type, Union from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Iterable,
List,
Mapping,
Optional,
Sequence,
Set,
Tuple,
Type,
Union,
)
from unittest.mock import patch from unittest.mock import patch
from weakref import ReferenceType from weakref import ReferenceType
@ -406,7 +420,6 @@ def djc_test(
return decorator return decorator
def _merge_django_settings( def _merge_django_settings(
django_settings: Optional[Mapping[str, Any]] = None, django_settings: Optional[Mapping[str, Any]] = None,
components_settings: Optional[Union[Mapping[str, Any], "ComponentsSettings"]] = None, components_settings: Optional[Union[Mapping[str, Any], "ComponentsSettings"]] = None,
@ -436,6 +449,7 @@ def _components_to_mapping(
return dict(value._asdict()) return dict(value._asdict())
raise TypeError("COMPONENTS must be a mapping or ComponentsSettings") raise TypeError("COMPONENTS must be a mapping or ComponentsSettings")
def _setup_djc_global_state( def _setup_djc_global_state(
gen_id_patcher: GenIdPatcher, gen_id_patcher: GenIdPatcher,
csrf_token_patcher: CsrfTokenPatcher, csrf_token_patcher: CsrfTokenPatcher,