diff --git a/tests/helpers.py b/tests/helpers.py deleted file mode 100644 index adb4d582..00000000 --- a/tests/helpers.py +++ /dev/null @@ -1,28 +0,0 @@ -"""Tests for DocutilsView template view.""" -import typing as t - -from django.template.engine import Engine - -if t.TYPE_CHECKING: - import sys - import types - - from typing_extensions import TypeAlias - - # https://github.com/python/typeshed/blob/f7aa7b7/stdlib/builtins.pyi#L1461 - if sys.version_info >= (3, 10): - _ClassInfo: TypeAlias = type | types.UnionType | tuple["_ClassInfo", ...] - else: - _ClassInfo: TypeAlias = type | tuple[_ClassInfo, ...] - - -def get_template_engine( - using: "_ClassInfo", -) -> None | Engine: - """Return Template Engine (e.g. DocutilsTemplates), for augmenting dirs in tests.""" - from django.template import engines - - for engine in engines.all(): - if isinstance(engine, using): - return t.cast(Engine, engine.engine) # type:ignore - return None